【算法图解】——实现每次打印输出暂停1秒

from time import sleep

def print_item2(alist):
    for item in alist:
        sleep(1) # 暂停1秒
        print(item)
        
print_item2([2, 5, 6, 9, 8, 7])

2
<1秒>
5
<1秒>
6
<1秒>
9
<1秒>
8
<1秒>
7

发布了165 篇原创文章 · 获赞 30 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/weixin_44478378/article/details/104413634