本文共 547 字,大约阅读时间需要 1 分钟。
lists = [[0 for col in range(3)] for row in range(4)]lists[0][2] = 3print(lists)
进度条
#.....import timescale = 50print("执行开始".center(scale//2, "-"))start = time.perf_counter()for i in range(scale+1): a = '*'*i b = '.'*(scale-i) c = (i/scale)*100 dur = time.perf_counter() - start print("\r{:^3.0f}%[{}->{}]{:.2f}s".format(c,a,b,dur),end = '') time.sleep(0.1)print("\n"+"执行结束".center(scale//2, "-"))
产生随机数范围[0,1)
转载地址:http://awbtb.baihongyu.com/