code: TU08 points: 12
Not only can you count numbers you can also repeat until a condition is met. The most common is While True.
You can use any IF statement that you need and when the condition is not met use the command break.
Exercise 1: Which subject do you love the most? Make the program continue to ask until they very smartly choose Computer Science.
Exercise 1: Which subject do you love the most? Make the program continue to ask until they very smartly choose Computer Science.
You can also use the While loop to test for a range of values. Note that you must set the variable before the While loop.
Exercise 2: Change the values of the while loop for a float rather than an int.
Exercise 2: Change the values of the while loop for a float rather than an int.