前言 如何用Python使首字母大写 将字符串转化为首字母大写? 使用title()方法完成。 代码如下(示例): strl="this is a book" print(strl.title()) #输出 #This Is A Book