Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 25 additions & 6 deletions git-practice.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,28 @@ def addItem(item):
toDoList.append(item)
return toDoList

userAns = input("Do you want to add to your list or quit? A/Q")
while userAns == "A":
item = input("What item do you want to add?")
addItem(item)
userAns = input("Do you want to add to your list or quit? A/Q")
print(toDoList)
def deleteItem(item):
removed = "Removed", str(item)
error = "Error"
if toDoList.count(item) >= 1:
toDoList.remove(item)
return removed
else:
return error

active = True
while active == True:
userAns = input("Do you want to add to your list, delete, or quit? A/D/Q ")
if userAns == "A":
item = input("What item do you want to add? ")
addItem(item)
print("Added", item)
elif userAns == "D":
item = input("What item do you want to delete? ")
deleteItem(item)
print("Deleted", item)
elif userAns == "Q":
active = False
break

print(toDoList)