编程语言
首页 > 编程语言> > python打印字符组合;多位字符组合

python打印字符组合;多位字符组合

作者:互联网

先不考虑多线程

import time

list = [chr(i) for i in range(ord('a'), ord('z') + 1)] + [chr(i) for i in range(ord('0'), ord('9') + 1)] + ['_']

print('程序开始时间:', time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(int(time.time()))))
start = time.time()

i = 0
for lst1 in list:
    for lst2 in list:
        for lst3 in list:
            for lst4 in list:
                i = i + 1
                print(i, ',', lst1 + lst2 + lst3 + lst4)

end = time.time()
print('程序结束时间:', time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(int(time.time()))))
print('程序用时:', end - start, 's')

标签:-%,字符,组合,python,list,int,time,print,ord
来源: https://www.cnblogs.com/cuishh/p/16246404.html