1.例子:
import random
li=[]for i in range(6):
temp=random.randrange(65,91)
li.append(chr(temp))
print(li)
result="".join(li)
print(result)
result=""
for j in li:
result+=j
print(result)
2.例子:
import random
li=[]
for i in range(6):
j=random.randint(0,5)
if j==2 or j==5:
num=random.randrange(0,10)
li.append(str(num))
else:
temp=random.randrange(65,91)
li.append(chr(temp))
print(li)
result="".join(li)
print(result)
result=""
for j in li:
result+=j
print(result)