📜  python f-string padding - Python代码示例

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

代码示例2
#!/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')