Last active
December 25, 2016 16:42
-
-
Save FaisalFehad/41587047f99834cf9ad7b5413ab48237 to your computer and use it in GitHub Desktop.
First Python Code. To do list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make a todo list | |
list = [] | |
# print the list | |
def show_items(): | |
print("Your current list has the times:") | |
for item in list: | |
print(item) | |
# add new tiems to the list | |
while True: | |
# ask for new itmes | |
user_input =input("What would you like to add to the list?, Type QUIT when you done or HELP if you need it ") | |
# able to quit the app | |
if user_input == "QUIT": | |
show_items() | |
break | |
# Show the saved times if requested | |
elif user_input == "SHOW": | |
show_items() | |
# Display help if requested | |
elif user_input == "HELP": | |
print("Help: To add list you only need to type in the itme name and press inter. You can type the 'SHOW' to see your current list") | |
else: | |
# Add times into the list | |
list.append(user_input) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment