Python随机数

Python随机数

1
2
3
4
# N 代表随机数的位数
import random, string

code = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(N))