PythonString swapcase() function returns a new string with uppercase characters converted to lowercase and vice versa. Python String swapcase()函数返回一个新字符串,其中大写字符转换为小写,反之亦然。 Python字符串swapcase() (Python String swapcase()) This function doesn’t accept any parameter. Note ...
sentence1.swapcase()- converts every uppercase character in"THIS SHOULD ALL BE LOWERCASE."to lowercase sentence2.swapcase()- converts every lowercase character in"this should all be uppercase."to uppercase sentence3.swapcase()- converts the mixed stringsentence3i.e."ThIs ShOuLd Be MiXeD cAsEd...
The Python String swapcase() function transforms the case of uppercase string characters to lowercase and vice versa. There is no parameter needed, and a string returns after case conversion. 1 The syntax of the method is: str.swapcase(); Key Points : • Return Type: String. • Parametr...