Ask Question
26 May, 08:44

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

+2
Answers (1)
  1. 26 May, 11:29
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers