I want program to change all lower letters to upper and vice versa but if there is same letters it only takes first eg. "Aa" it should change it to "aA", but it gives me "AA" instead "aA", I think because it changes always first letter
S = input()
for item in S:
if item.islower():
S = S.replace(item, item.upper())
elif item.isupper():
S = S.replace(item, item.lower())
print(S)