摘要:
1. python-字符串拼接 使用 “+” 可以对多个字符串进行拼接。 示例: str1 = "hello" str2 = "world" print(str1 + str2) 其他方式: 格式化输出 逗号 join() 内建函数,将序列中的元素拼接成一个字符串。后面讲到 2. 案例 案例1、字符 阅读全文
posted @ 2022-12-26 11:29
七月流星雨
阅读(151)
评论(0)
推荐(0)
摘要:
1. python 字符串格式化输出 示例代码 # 变量赋值 name = "张三" avg = 22 height = 1.75 方法1、使用(%s %d %f ) 格式化输出 print("我的名字叫:%s ,我的年龄是:%d , 我的升高是%0.2f 米 " %(name,avg,height 阅读全文
posted @ 2022-12-26 11:28
七月流星雨
阅读(164)
评论(0)
推荐(0)