因此,我尝试编写一个代码,在您使用raw_input
在输出中键入Goku之后,它将打印Hello Goku。当我输入Goku时,它什么也不做(在Python空闲GUI中)。
但在Python命令行中
File "<stdin>", line 1
print ("hello Goku")
^
IndentationError: unexpected indent
这是我的剧本:
x = raw_input('What is your name?')
if raw_input() == "Goku":
print ("hello Goku")
您需要比较if语句中的x。你知道吗
raw\u input()将用户输入存储到变量x中
相关问题 更多 >
编程相关推荐