Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # create empty list of exercises
- exercises = []
- # get user input, a string
- ex = input ("Which exercise are you doing today? ")
- # add exercise ex to list
- exercises.append (ex)
- # set ex to anything but "no"
- ex = "foo"
- # start loop if ex isn't "no"
- while (ex.lower() != "no"):
- # get user input
- ex = input ("Is there any other exercise that you would be doing? ")
- # test for "no" response, if not "no"...
- if ex.lower() != "no":
- # ...add ex to list
- exercises.append (ex)
- # print message
- print ("You will be doing the following exercises:")
- # print list
- print (exercises)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement