171k views
1 vote
4.1 code practice
Not sure what to do in here?

4.1 code practice Not sure what to do in here?-example-1

1 Answer

1 vote

Answer:

This is practice for you to understand how user input works and basic control flow of a program:

Line 1 : Establishes an infinite loop

Line 2: Gets the user's input from the console

Line 3: Checks to see if the user inputted "Nope"

Line 4: If the user inputted "Nope", this line will execute and "break" out of the while loop and end the program

Line 5: Otherwise, execute line 6

Line 6: Prints the message to the console and then goes back to start the loop again

4.1 code practice Not sure what to do in here?-example-1
User Petergus
by
7.4k points