-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTapCapOutfile.py
46 lines (34 loc) · 1.14 KB
/
TapCapOutfile.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
37
38
39
40
41
42
43
44
45
46
#Program that randomly picks 5 colors and discards colors that repeat
#Can work with multiple customers and display names of customers
import random
def main():
again = 'y'
while again == 'y':
#input customer name
name=input("Enter name of customer: ")
print("Customer Name: ", name)
list1=[]
excluded_list=[]
newList(list1, excluded_list)
#List of colors to be printed
print("Colors to be printed:")
for x in list1:
print(x,end=' ')
print()
#List of colors discarded
print("Repeated Colors(not to be printed):")
for y in excluded_list:
print(y,end=' ')
print()
print("Do you want to add customer?")
again=input("y=yes, anything else=no: ")
print()
def newList(list1, excluded_list):
while(len(list1)<5):
colors=['White', 'Red', 'Orange', 'Blue', 'Green', 'Black', 'Purple', 'Gold']
list=random.choice(colors)
if list not in list1:
list1.append(list)
else:
excluded_list.append(list)
main()