python生成特殊随机字符密码
import random import string n = 0; while n<10: str_source = string.ascii_letters + string.digits + string.punctuation str_list = random.sample(str_source,10) special=['/','\\','@','I','l','o','O'] if len(set(str_list) & set(special))==0: str_final = ''.join(str_list) print(str_final) n+=1