Given a variable s that is associated with the empty string, write some statements that use a while loop to associate s with a string consisting of exactly 777 asterisks (*) .

Respuesta :

Limosa

Answer:

Following are the program in the Python Programming Language.

#declare empty string variable

s=""

#declare variable that store "*" as string

x= "*"

#set the while loop

while(len(s) < 777):

   #initialize the value of 'x' in 's'

   s= x

   x += "*"

Explanation:

Following are the description of the program.

  • Set an empty variable to store the string type values.
  • Again, set a variable 'x' and initialize asterisks in it as a string.
  • Set the while loop that iterate, when the length of the variable 's' is less than 777, then initialize the value of the variable 'x' in the variable 's' and concatenate asterisks with the variable 's'.