-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
54 lines (50 loc) · 1.9 KB
/
app.py
File metadata and controls
54 lines (50 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#Inicialize
todo = []
print("Welcome To Py-ToDo APP!!\nMade by Bagi763")
#Define Functions
def add(Task):
todo.append(Task)
print(f"\nThe Task '{Task}' was Added to The ToDo List!")
def edit(Task, Edit):
if Task in todo:
todo.insert(todo.index(Task), Edit)
todo.remove(Task)
print(f"The Task: '{Task}' is Now '{Edit}'!!")
else:
print(f"Error: The Task: '{Task}' is not on The List")
def delete(Task):
todo.remove(Task)
print(f"The Task: {Task} has been Deleted!!")
#Run Program
while True:
print("\nWhat Command You Want to Run?")
print("-------------------------------")
print("List: Show The ToDo List")
print("Add: Add a Task to The ToDo List")
print("Edit: Edit a Task on The ToDo List")
print("Delete: Delete a Task on The ToDo List")
print("Quit: Quit The APP")
print("More: More of Bagi763")
command = input("Command: ")
if command == "List" or command == "list":
if len(todo) != 0:
print(f"\n{todo}")
else:
print("\nList Is Empty")
elif command == "Add" or command == "add":
add(input("Task: "))
elif command == "Edit" or command == "edit":
print(f"\nWhat Task You Want to Edit (Insert Task Number on The List)?\n{todo}")
edit(input("Task: "), input("Edit: "))
elif command == "Delete" or command == "delete":
print(f"\nWhat Task You Want to Delete?\n{todo}")
delete(input("Task: "))
elif command == "Quit" or command == "quit":
break
elif command == "More" or command == 'more':
print("\n\n\n------------------------------------------")
print("Github Profile: https://github.com/Bagi763\nBe-Team: https://github.com/be-rep")
print("------------------------------------------\n\n\n")
else:
print("\nError: Invalid Command")
print("\n\nBye!!")