循环不以while开头

2024-09-30 03:25:30 发布

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

我做错了什么

我需要向循环中的用户提问,但它没有运行

错误:-

error: EOFError: EOF when reading a line "msg = input("test: ")"

代码:-

def while2():
    while True:
        msg = input("test: ")
        time.sleep(10)

Tags: 代码用户testinputdef错误linemsg

热门问题