I\'m trying to solve this challenge in hackerrank, which asks to convert all lowercase letters to uppercase letters and vice versa.
I attempt it with the following code:
def swap_case(s): a=" " for i in s: if i==i.lower(): a=a+(i.upper()) else: a=a+(i.lower()) return (a)