1 作用
f"{...}"表达式是 python 中用来格式化输出的, 该方法更加简洁高效, 可读性更高
{} 大括号里是想要打印的东西
2 示例
a = 'Jack'
b = 'Maile'
print(f"{a} and {b} are good friends.")
>>Jack and Maile are good friends.
关于数字的格式化输出
x = 100
print(f'{x:05d}')
print(f'{x:.5f}')
>>> 00100
>>> 100.00000
x : 05d 表示对整数显示五位, 不够的补零
x : .5f 表示小数点后显示五位