sWAP cASE

  • + 0 comments

    The most easy way would be using swapcase() function but i would say is worth to check the following functions ->

    Explanation: char.isupper(): Checks if a character is uppercase. char.lower(): Converts an uppercase character to lowercase. char.upper(): Converts a lowercase character to uppercase. join(): Combines the transformed characters into a new string.

    This method avoids using .swapcase() and achieves the same result.