如何使输入线低于打印线?

时间:2017-09-18 12:53:34

标签: python

这就是我所拥有的:

choice = int(input("Choose an action")) - 1

在控制台中,它显示如下:

Choose an action(The user input goes here)

我想要的是:

Choose an action
(the user input goes here)

2 个答案:

答案 0 :(得分:4)

您可以打印消息,这将自动添加换行符:

print("Choose an action")
choice = int(input()) - 1

或者在输入消息的末尾手动添加换行符{\n

choice = int(input("Choose an action\n")) - 1

答案 1 :(得分:3)

只是这样做:

month
September
August
July
June