代码:
if start > 60:
print("It took the program",round(time.time()- start) // 60,"minute(s) and",round(time.time()- start,2) % 60,"second(s) to finish.")
代码中的问题是这部分:
round(time.time()- start,2)
它打印:0.000000000000
它应该打印:0.00
在一轮中使用除法/模数符号格式化代码:
round((time.time() - start) % 60)