李昱阳
#字符串格式化三种方式name= 'Alice'
age = 25
height=1.652
print('我的名字是'+name',我' + str(age) + '岁了,我的身高是' + str(height)+ '米')
print('我的名字是%s, 我%d岁了,我的身高是%.2f米'%(name , age , height))
weight = 70.5
print('我的名字是{} ,我 {} 岁了,我的体重是{}.'.format(name , age , weight))
print(f'我的名字是{name},我体重是{weight}.')
页:
[1]