-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCtd-1.2.py
36 lines (33 loc) · 1.07 KB
/
Ctd-1.2.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
35
36
import this
thisbox=[23,32,63,23,5,6]
def printf():
print(thisbox)
def removee(item):
if item==0:
thisbox.remove()
else:
thisbox.remove(item)
def additem(item):
thisbox.append(item)
while True:
printf()
try:
user_command=input("type enter or remove: ")
if user_command=="remove":
user_remove=input("remove any or remove a specific NO.: ")
if user_remove=="remove any":
if thisbox.count==5:
print("can't romve anymore")
else:
removee(0)
elif user_remove=="specific":
item=int(input("enter the number you want to remove"))
if thisbox.count==5:
print("can't romve anymore")
else:
removee(item)
elif user_command=="enter":
item=int(input("enter the number you want to add: "))
additem(item)
except:
print("invalid input try again ")