学习笔记(48):Python 面试100讲(基于Python3.x)-格式化整数和浮点数

立即学习:https://edu.csdn.net/course/play/26755/340116?utm_source=blogtoedu

 用format函数格式化整数

>左边补0

<右边补0

0.2f保留小数点后两位

format函数用于格式化数值,通过第2个参数指定格式化规则

发布了73 篇原创文章 · 获赞 3 · 访问量 674

猜你喜欢

转载自blog.csdn.net/weixin_43186090/article/details/104433127