We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
sWAP cASE
You are viewing a single comment's thread. Return to all 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.