有没有办法在同一行打印的两个字之间进行延迟

2024-06-16 12:39:00 发布

您现在位置:Python中文网/ 问答频道 /正文

import time 

x = 1000

while True:

time.sleep(0.05)

x = x - 7

print(x)

if x == 6:
    time.sleep(1)
    print("first", end=" ")
    print("second")
    break 

我想在两个字之间耽搁几秒钟。我倒计时,最后在同一行中延迟打印两个WRD


Tags: importtrueiftimesleependfirstprint
1条回答
网友
1楼 · 发布于 2024-06-16 12:39:00
import time 

x = 1000

while True:

    time.sleep(0.05)
    x = x - 7
    print(x)

    if x == 6:
        print("first", end=" ", flush=True)
        time.sleep(1)
        print("second")
        break 

相关问题 更多 >