1s=input()
2new_str=""
3for i in range (len(s)):
4 if s[i].isupper():
5 new_str+=s[i].lower()
6 elif s[i].islower():
7 new_str+=s[i].upper()
8 else:
9 new_str+=s[i]
10print(new_str)
11
12
1a = 10
2b = 20
3print("not swiped value of a is",a)
4print("not swiped value of b is",b)
5stored_value = a
6a = b
7b = stored_value
8print("swiped value of a is",a)
9print("swiped value of b is",b)
10
11
1def swap0(s1, s2):
2 assert type(s1) == list and type(s2) == list
3 tmp = s1[:]
4 s1[:] = s2
5 s2[:] = tmp
6
7# However, the easier and better way to do a swap in Python is simply:
8s1, s2 = s2, s1
1def swap_string():
2 s=input()
3 swapped_string=""
4 swapped_string+=s.swapcase()
5 return swapped_string