sWAP cASE

  • + 1 comment

    def swap_case(s): new_string = '""

    for i in s:
        if i.isupper():
            i = i.lower()
            new_string = new_string + i
        elif i.islower():
            i = i.upper()
            new_string = new_string + i
        else:
            new_string = new_string + i
    
    return new_string