The World Wide Web, restored to 800 pixels of glory.
GeezerVison is showing www.runoob.com — Python 练习实例9 | 菜鸟教程
Python 100例
题目:暂停一秒输出。
程序分析:使用 time 模块的 sleep() 函数。
程序源代码:
以上实例输出结果为(会有停顿效果):
1 a 2 b
Kunz
sun***[email protected]
每隔一秒输出列表一个元素:
#!/usr/bin/python # -*- coding: UTF-8 -*- import time l=[1,2,3,4] for i in range(len(l)): print l[i] time.sleep(1) # 暂停一秒输出
取消