摘要: 1.使用round()函数: number = 3.14159 rounded_number = round(number, 2) print(rounded_number) # 输出: 3.14 2. 使用字符串格式化: number = 3.14159 formatted_number = '{ 阅读全文
posted @ 2023-12-04 14:59 python学习者0 阅读(1302) 评论(0) 推荐(0) 编辑