官方解释:Return a copy of the string with its first character capitalized and the rest lowercased.(返回字符串的副本,其首字符大写,其余字符小写.) 使用方法: >>> s1 = 'python最牛掰' >>> ret1 = s1.capitalize() >>> print(ret1) Python最牛掰…
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法capitalize() #capitalize() #说明:将字符串的第一个字母变成大写,其他字母变小写. ''' capitalize(...) S.capitalize() -> string Return a copy of the string S with only its first character capitalized. ''' #案例 str='xiaoden…