自学python,想搜这个答案,没找到合适的,现附上自己写的代码:
import time #加载time模块
for i in range(10,0,-1):
print(f'r倒计时{i}秒',end='') #r让光标回到行首 ,end=''--结束符为空,即不换行
time.sleep(1) #让程序等待1秒
else:
print('r倒计时结束')
自学python,想搜这个答案,没找到合适的,现附上自己写的代码:
import time #加载time模块
for i in range(10,0,-1):
print(f'r倒计时{i}秒',end='') #r让光标回到行首 ,end=''--结束符为空,即不换行
time.sleep(1) #让程序等待1秒
else:
print('r倒计时结束')