You are viewing a single comment's thread. Return to all comments →
def swap_case(s): l =[] for char in s: if char.islower(): char = char.upper() l.append(char) elif char.isupper(): char =char.lower() l.append(char) else: l.append(char) l1 =''.join(l)
return l1
if name == 'main': s = input() result = swap_case(s) print(result)****
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 →
def swap_case(s): l =[] for char in s: if char.islower(): char = char.upper() l.append(char) elif char.isupper(): char =char.lower() l.append(char) else: l.append(char)
l1 =''.join(l)
if name == 'main': s = input() result = swap_case(s) print(result)****