我想编写一个程序,在该程序中,我将无限次打印“done”,并且除了打印次数之外,我还打印了“done”。但我认为我使这个过程变得更加困难。 这是否可以仅使用循环或任何最简单或简单的方法来打印输出,就像我的代码输出一样?
import os
from time import sleep
from IPython.display import clear_output
temp=""
count=0
while(True):
count+=1
for i in range(0,count):
temp+="done"
temp+="\n"
print("Total Done :",count)
print(temp)
temp=""
sleep(1.5)
os.system("clear")
clear_output()