python返回随机字符
返回随机的指定长度的数字加字母的字符串
import random def getRandomSet(bits): num_set = [chr(i) for i in range(48,58)] char_set = [chr(i) for i in range(97,123)] total_set = num_set + char_set value_set = "".join(random.sample(total_set, bits)) return value_set