摘要: Python使用format与f-string数字格式化 ##### 使用format或f-string将数字类型(int, float)转化为特定格式的字符串类型 n = 12 # 语法1 (Python2.6及以上) print('[{}] -> [{:0=3d}] 整数补零 (宽度为3)'.f 阅读全文
posted @ 2021-03-16 01:09 柯林斯的夏天 阅读(365) 评论(0) 推荐(1)