54青年节作业
#字符串格式化三种方式name = 'Alice'
age = 25
height = 1.65
print('我的名字是 %s, 我 %d 岁了, 我的身高是 %.2f 米.' %(name, age, height))
weight = 70.5
print('我的名字是 {}, 我 {}岁了, 我的体重是 {} .'.format(name, age, weight))
print(f'我的名字是 {name}, 我 {age} 岁了, 我的体重是 {weight} .')
页:
[1]