方法一(使用string):
1 import string 2 import random 3 4 s = string.ascii_letters 5 r = random.choice(s) 6 print(r)
方法二(使用ch())
import random s = random.ranint(65,90) r = ch(s) print(s)
python 获取随机字母
原文:http://www.cnblogs.com/guoxueyuan/p/6898765.html