我正在做一个简单的小平均计算器。
def avg():
sumSoFar = 0
count = 0
numCount = 0
while numCount != "":
numCount = eval(input("Please enter a number or press <enter> to quit: "))
sumSoFar += numCount
count += 1
print("The average of these numbers is: ", sumSoFar/count)
我不断收到错误:
numCount = eval(input("Please enter a number or press <enter> to quit: "))
File "<string>", line 0
Syntax Error: unexpected EOF while parsing
知道什么问题吗?