Ask Question

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 (*).

+3
Answers (1)
  1. 27 May, 02:48
    0
    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'.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “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 ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers