为什么打印在Python中不适用于我?

时间:2017-09-03 02:23:37

标签: python

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尝试了一个字符,它仍然无效。

2 个答案:

答案 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字格式的文本,所以你可能想要改变它们,每一件事都能奏效。