双色球源码
redball = []
blueball = []
select_redball = []
select_blueball = []
red = 1
blue = 1
for i in range(1, 33):
redball.append(i)
for i in range(1, 17):
blueball.append(i)
print(redball, blueball)
try:
while red < 7:
i = int(input(f"\033[0;31;40m[{red}]select red ball:\033[0m"))
if i not in redball:
print("only can select n between 1-32")
elif i in select_redball:
print(f"number {i} is already exist in red ball list")
else:
select_redball.append(i)
red = red+1
while blue < 3:
h = int(input(f"\033[0;34;40m[{blue}]select blue ball:\033[0m"))
if h not in blueball:
print("only can select n between 1-16")
elif h in select_blueball:
print(f"number {h} is already exist in red ball list")
else:
select_blueball.append(h)
blue = blue+1
print("Red ball:", select_redball)
print("Blue ball:", select_blueball)
print("Good Luck.")
except:
print("输入有误")