格式化输出最简单的方式之哑巴填充公式
name=ludundun
age=25
print(f'hello {name},your age is {age}')
输出内容:
hello ludundun,your age is 25
Sally=6.66666666
print(f'your Sally is {Sally:.3f}')
精确获取小数点后三位进行结果输出。
输出内容:
your Sally is 6.667
2024-03-18 07:59:16
格式化输出最简单的方式之哑巴填充公式
name=ludundun
age=25
print(f'hello {name},your age is {age}')
输出内容:
hello ludundun,your age is 25
Sally=6.66666666
print(f'your Sally is {Sally:.3f}')
精确获取小数点后三位进行结果输出。
输出内容:
your Sally is 6.667