代码
my_name = "YingXu"
my_age = 35
my_height = 165
my_weight = 63.7
my_eyes = 'Black'
my_teeth = 'White'
my_hair = 'Black'
print(f"Let's talk about {my_name}.")
print(f"He's {round(my_height/2.54)} inches tall.")
print(f"He's {round(my_weight/0.5435924)} 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 actually {my_teeth} depending on the coffee")
total = my_age + my_height + my_weight
print(f"If I add {my_age}, {my_height}, and {my_weight} I get {total}.")
'''
如果想要在引号""中使用变量
必须要使用大括号{}
'''
遇到问题
没遇到问题
学到的
1、变量要用字母开头,所以阿拉伯数字不能作为变量;
2、{}内的内容,其实就是在“”内想使用变量时候的做法,避免python把变量当做字符。