当前位置: 编程技术>python
python实现倒计时的示例
来源: 互联网 发布时间:2014-09-04
本文导语: 代码如下:import timecount = 0 a = input('time:') b = a * 60 while (count < b): ncount = b - count print ncount time.sleep(1) count += 1 print 'done'
代码如下:
import time
count = 0
a = input('time:')
b = a * 60
while (count < b):
ncount = b - count
print ncount
time.sleep(1)
count += 1
print 'done'