python中字符串的操作

一. 字符串创建 1.str1 = 'hello world' 2.str2 = "hello world" 3.str3 = """hello world""" 注:三引号可以进行块注释,将多行代码注释掉,还可进行字符串格式化 4. 转译符号 一个反斜线加一个单一字符可以表示一个特殊字符,通常是不可打印的字符 \n: 代表换行符                   \": 代表双引号本身 \t:
相关文章
相关标签/搜索