如何解决python中出现的SyntaxError: unexpected EOF while parsing

这是我的代码

salary = input("请输入您的薪水:")
things = [["iphone","5000"],["mac pro","12000"],["coffee","31"],["book","81"],["bike","800"]]
while True :
    

错误类型为

  File "C:/Users/googol/PycharmProjects/untitled/shopping.py", line 5
    
        ^
SyntaxError: unexpected EOF while parsing


Process finished with exit code 1

解决:因为我写的代码构成了无限循环,所以报错,解决即为添加结束条件

你可能感兴趣的:(python学习常见问题,python)