Lecture 10 Exercises

Using a while loop, create a list numbers that contains the numbers 0 through 35. Your while loop should initialize a counter variable to 0. On each iteration, the loop should append the current value of the counter to the list and the counter should increase by 1. The while loop should stop when the counter is greater than 35.

Write code that uses a while loop to accept input from a user repeatedly, until the user inputs the string "stop".

(We cannot write tests for this because it requires user input, so you’ll just have to gauge whether it works correctly yourself!)

Next Section - Lecture 3 Exercises