字符串错误?错误:语法无效(<字符串>,第9行)

时间:2019-03-30 11:47:26

标签: python

我遇到以下错误:语法无效(第9行)

尝试通过“以艰难的方式学习Python 3”这本书,但我似乎无法在语句中找到错误...

my_name = 'Zed A. Shaw'
my_age = 35 # not a lie
my_height = 74 # inches
my_weight = 180 # lbs
my_eyes = 'Blue'
my_teeth = 'White'
my_hair = 'Brown'

print(f"Lets talk about {my_name}.")
print(f"He's{my_height}inches tall.")
print(f"He's{my_weight}pounds heavy.")
print("Actually that's not too heavy")
print(f"He's got {my_eyes}eyes and {my_hair}hair.")
print(f"His teeth are usually{my_teeth} depending on the coffee")

# this line is tricky, try to get it exactly right
total= my_age + my_height + my_weight
print(f"If I add {my_age},{my_height}, and {my_weight} I get {total}.")

0 个答案:

没有答案