str = "www.runoob.com"
print(str.upper())          # 把所有字符中的小写字母转换成大写字母
print(str.lower())          # 把所有字符中的大写字母转换成小写字母
print(str.capitalize())     # 把第一个字母转化为大写字母,其余小写
print(str.title())          # 把每个单词的第一个字母转化为大写,其余小写 

输出
WWW.RUNOOB.COM
www.runoob.com
Www.runoob.com
Www.Runoob.Com

 

相关文章:

  • 2021-08-29
  • 2021-12-05
  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-18
  • 2021-11-27
  • 2021-05-25
  • 2021-11-08
  • 2021-12-23
相关资源
相似解决方案