2024-05-03 07:18:42 发布
网友
首先,我对编程和python都是新手,所以我提前道歉。在
我试图使用原始输入从用户那里获取输入,但也在努力使代码更简单。在
我最初的想法是:
print "Please give the name of your project." project_name = raw_input()
这给了我: “请给出您的项目名称。” 试验
为了缩短时间,我改为:
这给了我: “请给出你的项目名称。”测试
所以它要求用户在提示后立即输入信息。我想换一条新线路。在
只需在提示中添加新行:
project_name = raw_input("Please give the name of your project.\n")
你可以换一行:
>>> project_name = raw_input("Please give the name of your project.\n") Please give the name of your project. myProject >>> project_name 'myProject' >>>
在提示字符串中,\n创建一个换行符。在
\n
只需在提示中添加新行:
你可以换一行:
在提示字符串中,
\n
创建一个换行符。在相关问题 更多 >
编程相关推荐