sWAP cASE

  • + 0 comments

    new_str = "" for char in s: if not char.isalpha(): new_str += char elif char.isupper(): new_str += char.lower() elif char.islower(): new_str += char.upper() return new_str