dayOfWeek = input("Enter the day of week:")
stepsWalked = input("Enter how many steps were walked:")
milesWalked = float(stepsWalked)/2000
caloriesBurned = milesWalked * 65
print ("The day of the week is ”, dayOfWeek, “. The amount of miles walked is “, milesWalked, “. The amount of calories burned are “, caloriesBurned)
ParseError:第10行的错误令牌
一直想弄清楚这个错误。我不知道为什么无论我做什么我都无法工作print
。仅仅print
尝试了一个字符,它仍然无效。
答案 0 :(得分:-2)
工作代码是:
dayOfWeek = input("Enter the day of week:")
stepsWalked = input("Enter how many steps were walked:")
milesWalked = float(stepsWalked)/2000
caloriesBurned = milesWalked * 65
print("The day of the week is ", dayOfWeek, ". The amount of miles walked is ", milesWalked, ". The amount of calories burned are ", caloriesBurned)
代码中的错误来自于使用“
而非"
。
答案 1 :(得分:-2)
如果你看一下你的陈述中的引号,它们与python接受的不同,也许它是一个MS字格式的文本,所以你可能想要改变它们,每一件事都能奏效。