to_do_list = ["Make a to-do list","Learn Python"] name =input("Hello, I am going to help you to write a to-do list. Let's start with your name: ".strip()) action = (input("What would you like to do?(View, Add or Remove): ".strip())).capitalize() ID = 3 while True: if action == "View": print (*to_do_list,sep =', ') action = (input("What would you like to do?(View, Add or Remove): ".strip())).capitalize() elif action == "Add": to_do_list.append(input("What would you like to add?: ")) print("Great! {}'s to-do list now looks like this:".format(name)) print (*to_do_list,sep =', ') action = (input("What would you like to do?(View, Add or Remove): ".strip())).capitalize() elif action == "Remove": print("Okay, we can do that. Please have a look at your current list,{}: ".format(name)) print (*to_do_list,sep =', ') to_do_list.remove(input("What would you like to remove?: ")) print("Great! {}'s to-do list now looks like this:".format(name)) print (*to_do_list,sep =', ') action = (input("What would you like to do?(View, Add or Remove): ".strip())).capitalize() ##create a dictionary instead of list for the to-do, key as a number (ID) value as to-do
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question