Advertisement
brilliant_moves

ExerciseProgram.py

Nov 28th, 2015
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. # create empty list of exercises
  2. exercises = []
  3. # get user input, a string
  4. ex = input ("Which exercise are you doing today? ")
  5. # add exercise ex to list
  6. exercises.append (ex)
  7. # set ex to anything but "no"
  8. ex = "foo"
  9.  
  10. # start loop if ex isn't "no"
  11. while (ex.lower() != "no"):
  12.     # get user input
  13.     ex = input ("Is there any other exercise that you would be doing? ")
  14.     # test for "no" response, if not "no"...
  15.     if ex.lower() != "no":
  16.         # ...add ex to list
  17.         exercises.append (ex)
  18.  
  19. # print message
  20. print ("You will be doing the following exercises:")
  21. # print list
  22. print (exercises)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement