我制作的一个简单程序有问题。
num2 = 0
num1 = 1
print ("Enter a number one after another to sum them up, and when you're done type 0")
while num1 != 0:
num1 = float(raw_input ("Please enter a number:")
num2 += num1
if num1 == 0:
print ("The sum of the numbers is:" + str(num2))
由于某种原因,该行num2 += num1
给了我一个语法错误num2
。