摘要: format() 是 Python 中的一个字符串方法,用于格式化字符串。您可以使用大括号 {} 在字符串中插入占位符,然后在 format() 函数中提供要插入的值。 下面是一些例子: 基本用法: print('Hello, {}!'.format('world')) # 输出: Hello, w 阅读全文
posted @ 2024-05-28 10:15 安琪儿一直在 阅读(8) 评论(0) 推荐(0) 编辑