Python program to toggle Case of string

 x=input("Enter String ")

f=len(x)

for i in range(0,f):

    z=ord(x[i])

    if z>=65 and z<91:

        print(chr(z+32),end=" ")

    elif z>=97 and z<122:

        print(chr(z-32),end=" ")

Comments