python - 字母大小写转换

python - 字母大小写转换

利用python内置函数

  • upper():所有字母大写
  • lower():所有字母小写
  • capitalize():首字母大写,其他字母小写
  • title():每个单词的首字母大写,其他小写

示例:

a = Abc
b = a.upper()
print(b)
#输出:ABC

猜你喜欢

转载自blog.csdn.net/weixin_44823747/article/details/108101910