import time n = 3 while n>0: print(n) time.sleep(1) # 可以让程序停止一段时间,单位为秒,可以设置int或float n-=1 print('END') 得到: