这是我的:
choice = int(input("Choose an action")) - 1
在控制台中显示如下:
Choose an action(The user input goes here)
我想要的是:
Choose an action
(the user input goes here)
最佳答案
您可以打印消息,这将自动添加一个换行符:
print("Choose an action")
choice = int(input()) - 1
或者在输入消息的末尾手动包含一个换行符 (\n
):
choice = int(input("Choose an action\n")) - 1
关于python - 如何使输入行低于打印行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46279794/