import random
choice = " "
for i in range(4):
choice +=str(i)
print(choice)
加入随机:
import random
choice = ""
for i in range(4):
current = random.randrange(0,4)
if current == i:
tem =chr (random.randint(65,90))
else:
tem = random.randint(0,9)
choice +=str(tem)
print(choice)
原文:https://www.cnblogs.com/nxb-1573/p/14279534.html