Please Login in order to post a comment
def swap_case(s): r="" for i in s: if(i==i.lower()): r+=i.upper() elif(i==i.upper()): r+=i.lower() else: r+=i result r
def swap_case(s): txt = "" for char in s: if char.isupper(): txt += char.lower() else: txt += char.upper() return txt
There is a method in python by which is swap_case(). You can use this instead of boring coding.
def swap_case(s): return s.swapcase() if __name__ == '__main__': s = input() result = swap_case(s) print(result)
def swap_case(s): result ="" for i in s: if i.islower(): result += i.upper() else : result += i.lower() return result
if name == 'main': s = input() result = swap_case(s) print(result)
def swap_case(s): swap = "" for char in s: if char.isupper(): swap = swap + char.lower() else: char.islower() swap = swap + char.upper() return swap
Seems like cookies are disabled on this browser, please enable them to open this website
def swap_case(s): r="" for i in s: if(i==i.lower()): r+=i.upper() elif(i==i.upper()): r+=i.lower() else: r+=i result r
There is a method in python by which is swap_case(). You can use this instead of boring coding.
def swap_case(s): result ="" for i in s: if i.islower(): result += i.upper() else : result += i.lower() return result
if name == 'main': s = input() result = swap_case(s) print(result)
def swap_case(s): swap = "" for char in s: if char.isupper(): swap = swap + char.lower() else: char.islower() swap = swap + char.upper() return swap