Python 循环打印星号并添加换行符
您可以使用以下代码来实现:
import time
for i in range(100):
print('*')
time.sleep(1)
if i % 100 == 0:
print('
' * 100)
这个代码会在每个星号之间停顿 1 秒钟,同时每打印 100 个星号就会累计 100 个换行符。
原文地址: https://www.cveoy.top/t/topic/lDVu 著作权归作者所有。请勿转载和采集!