运行python scrip时出错

2024-04-18 22:42:57 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在运行下面的python脚本

Price = []
Item = input("Enter the price of each item and seperate each price by line. Enter the blank line once you entered all prices. ")
while Item != "":
    Item = input("")
    Price.append(Item)
print(Price)

我得到下面的错误。请帮忙

/Users/piyush/PycharmProjects/Test1/venv/bin/python /Users/piyush/Desktop/LearningProgramming/Python/Exercises/Exercise3/3.64.py
Enter the price of each item and seperate each price by line. Enter the blank line once you entered all prices. 12
23
Traceback (most recent call last):
  File "/Users/piyush/Desktop/LearningProgramming/Python/Exercises/Exercise3/3.64.py", line 11, in <module>
    Item=input("")
  File "<string>", line 0

    ^
SyntaxError: unexpected EOF while parsing
Process finished with exit code 1

Tags: andoftheinputbylineitemusers