-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnine2.py
34 lines (27 loc) · 856 Bytes
/
nine2.py
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
mylist=[]
t=True
while t:
print("Would you like to")
print("(1)Add or")
print("(2)Remove items or")
choice=int(input("(3)Quit?: "))
if (choice==1) :
add=input("What will be added?: ")
mylist.append(add)
elif (choice==2):
print("There are",len(mylist),"items in the list.")
itemdeleted=int(input("Which item is deleted?: "))
t=True
try:
mylist.pop(itemdeleted)
except:
print("Incorrect selection.")
t=True
elif(choice==3):
print("The following items remain in the list:")
for i in mylist :
print(i)
t=False
else:
print("Incorrect selection.")
t=True