You are viewing a single comment's thread. Return to all comments →
def swap_case(s): l = '' for i in range(len(s)): if s[i].isupper(): l += f'{s[i].lower()}' elif s[i].islower(): l += f'{s[i].upper()}' else: l += s[i]
return l
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 i in range(len(s)): if s[i].isupper(): l += f'{s[i].lower()}' elif s[i].islower(): l += f'{s[i].upper()}' else: l += s[i]
if name == 'main': s = input() result = swap_case(s) print(result)