📜  f 字符串浮点格式 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:48.163000             🧑  作者: Mango

代码示例4
#!/usr/bin/env python3

name = 'Peter'
age = 23

print('%s is %d years old' % (name, age))
print('{} is {} years old'.format(name, age))
print(f'{name} is {age} years old')