'''本节知识点:print函数
格式化字符串
'''
(1)f-string方式
name = "青山"
score1 = 150
score2 = 150
print(f' {name}的总成绩是:{score1+score2} ')
(2).format()方式
name = '山姆'
salary = 4680
print("{}的月薪是:{}".format(name,salary))

(3) % 方式
vegetable = '''青菜'''
price = 2.1
total = 3.5
print("购买 %s 一共花了 %.2f 元。" % (vegetable,total*price))
(4)习题
#使用f-string方式和.format方式完成如下试题
#输出 "2025年的房租是6000"
rent = '房租'
price1 = 6000
print() #修改此行,此行用f-string方式
print() #修改此行,此行用.format方式