python_lower函数_2021-06-05
程序员文章站
2022-04-27 18:40:22
...
>>> s='Python Is Open.'
>>> s.lower()
'python is open.'
>>> print(s.lower)
<built-in method lower of str object at 0x00000236D5763C30>
>>> print(s.lower())
python is open.
>>> s='Python IS OpeN.'
>>> print(s.lower())
python is open.
可以看到 lower函数是输出字符串的所有字母小写形式
>>> print(s)
Python IS OpeN.
同样的是字符串s是不可变变量,没有进行更改