Blog
To-Do List!
- Harshit
- July 19, 2020
- 10:41 am
- No Comments
Create a to-do list to note down your daily chores or shopping items with this beginner level code!
Welcome to the code! You can make a list of the items you wanna buy during your shopping or the chores you gotta do in a day with this simple code.
In this code, you can make a to-do list on your own for your requirements. Further, you can also check out the list and remove them when you are done with the chores or got the items you have to buy.
Note: Loved the post? You too can publish your article on “Python for fun” which will be loved by millions. Contribute an article!
user_input = 99
data = []
def show_menu():
print("Menu: ")
print("1. Add items to the list")
print("2. Mark the item as done")
print("3. Show items in the list")
print("4. Exit")
return
def input_1():
global choose
item = input("Name the item that has to be added: ")
data.append(item)
print(item, "is added to the list.")
choose = input("Do you want to add more?")
return choose
while user_input != 4:
show_menu()
user_input = int(input("Choose an option from the menu: "))
if user_input == 1:
input_1()
while choose == "Yes" or choose == "yes":
input_1()
elif user_input == 2:
item = input("Name the item that has to marked as done: ")
if item in data:
data.remove(item)
print(item, "is removed from the list")
else:
print("The ",item," is not there in the list")
elif user_input == 3:
for item in data:
print(item)
elif user_input == 4:
print("Good bye!")
else:
user_input = int(input("Please choose an option from the menu"))
Share on facebook
Share on whatsapp
Share on pinterest
4
1
vote
Rating
Subscribe
Login
0 Comments
Inline Feedbacks
View all comments