摘要:
rstrip():删除字符串末尾空白 first_name="tuboshu " print(first_name) print(first_name.rstrip()) first_name=first_name.rstrip() print(first_name) lstrip():删除字符串行 阅读全文
posted @ 2022-03-29 23:16
NiceTwocu
阅读(39)
评论(0)
推荐(0)
摘要:
\t 在字符串中添加制表符 点击查看代码 print("python") print("\t python") 执行结果 点击查看代码 python python \n 在字符串中添加换行符 点击查看代码 print("languages:\nPython\nc\njavaScript ") 执行结 阅读全文
posted @ 2022-03-29 23:08
NiceTwocu
阅读(81)
评论(0)
推荐(0)
摘要:
字符串就是一系列字符。在Python中,用引号括起的都是字符串,其中的引号 可以是单引号,也可以是双引号 title() :以首字母大写的方式显示每个单词,即将每个单词的首字母都改为大写。 点击查看代码 name = "cy lovelace" print(name.title()) 全部 uppe 阅读全文
posted @ 2022-03-29 15:16
NiceTwocu
阅读(36)
评论(0)
推荐(0)

浙公网安备 33010602011771号