SyntaxError:在python中解析时出现意外的EOF

时间:2014-12-31 08:03:59

标签: python

我在python中遇到上述错误。

w=[]
h=[]
l=int(input())
t=int(input())

for i in range(t):
    n=raw_input()
    w.append(n)
    n=int(input())
    h.append(n)

for i in range(t):
    if w<l and h<l:
        print ("UPLOAD ANOTHER")
    elif w>l and h>l and w!=h:
        print ("CROP IT")
    elif w>=l and h>=l and w==h:
        print("ACCEPTED")

2 个答案:

答案 0 :(得分:0)

您可能为n=int(input())部分提供了空输入或'\ n'。尝试将数字作为输入。

将此行放入您的终端 x = int(input())。并给出空输入,(只需点击输入)。挥之不去..

SyntaxError: unexpected EOF while parsing

答案 1 :(得分:0)

您可能正在某些在线IDE上运行脚本。在我提交解决方案时,这对我也很明显。最好的解决方法是不要在在线ide上运行脚本,而直接提交它。

如果答案正确,它将被接受,否则显示错误答案。