Quick actions

cmd+k|ctrl+k

Navigation

Languages

33-7

Snippet info

Language

Python

Visibility

public

Author

python100

Created

2025-08-01T17:40:06.529802Z

Updated

2025-08-01T17:40:06.529802Z

myPartyList = []
def printList():
  print() 
  for item in myPartyList:
    print(item)
  print() 
while True:
  menu = input("add or remove?: ")
  if menu == "add":
    item = input("Who should I add to the party list?: ")
    myPartyList.append(item)
  elif menu == "remove":
    item = input("Who should I remove from the party list?: ")
    if item in myPartyList:
      myPartyList.remove(item)
    else:
      print(f"{item} was not in the list")
  printList()
  
  
INFO