str.lower() 字符串全小写。str.upper() 字符串全大写。
>>> str = 'my world, MY PYTHON'
>>> str.lower()
'my world, my python'
>>> str.upper()
'MY WORLD, MY PYTHON'
如何才能使字符串每个单词首字母都大写? 使 str = 'My World, My Python'
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
参考文章:Python字符串操作相关问题
字符串大小写转换