您好,我是一个noob,刚开始使用python,所以我想用raw_input
玩得开心,添加一些随机的问题和东西,但是我遇到了一个错误。它说无效的语法是”。我一直试图把它放在不同的地方,但没有成功我很抱歉,如果这是一个非常愚蠢的问题,但有人能帮我出来。你知道吗
这里有一行错误
print " Oh okay then %s . You came from %s , right? Oh i see you came here to %s" % (name,so,fun)
它指向%s
旁边的结束语
我在用atom
编辑:这里是错误
File "C:\Users\USER\AppData\Local\atom\app-1.26.1\Testing.py", line 10
print " Oh okay then %s . You came from %s , right? Oh i see you came here %s. " % (name, so, fun)
^
SyntaxError: invalid syntax
完整代码如下:
name = raw_input("Hello whats your name?")
so = raw_input("From where did you come from")
fun = raw_input("Interesting, why did you come here?")
#start the sentence with "for"
print " Oh okay then %s . You came from %s , right? Oh i see you came here %s. " % (name, so, fun)
如果我不能用raw_input
,那我能用什么呢?我学会了用它。你知道吗
我通过在整件事上加括号来解决这个问题,比如
我还认为原始的输入被替换为'input()'。你知道吗
相关问题 更多 >
编程相关推荐