# import random# for x in range(10):# i = 0# l = []# while i < 10:# ret = chr(random.randint(33, 126))# if ret not in [‘/‘,‘\\‘,‘@‘,‘I‘,‘l‘,‘o‘,‘O‘]:# i+=1# l.append(ret)# print(‘‘.join(l)) import randomimport stringfor x in range(10): str_source = string.ascii_letters + string.digits + string.punctuation str_list = random.sample(str_source,7) if str_list not in [‘/‘,‘\\‘,‘@‘,‘I‘,‘l‘,‘o‘,‘O‘]: str_final = ‘‘.join(str_list) print(str_final)
原文地址:https://www.cnblogs.com/tengfei520/p/8794242.html
时间: 2024-10-06 03:07:16