摘要:
字符串的格式化 顺序传参 索引传参 关键字传参 容器类型传参(列表和元组) {}相当于占位符 1 顺序传参 strvar = "他{}牺牲自己,{}出卖组织" res = strvar.format("宁愿","也不") print(res) res = strvar.format("白白","忘了 阅读全文
摘要:
字符串相关函数 1 capitalize 字符串首字母大写 strvar = "this is a dog" res = strvar.capitalize() print(res) 执行 [root@node10 python]# python3 test.py This is a dog 2 t 阅读全文