samedi 28 septembre 2019

plz help me with this

x = input('enter any character :')
if x >= 'A' and x <= 'Z':
    print('you entered a uppercase letter')
elif x >= 'a' and x <= 'z':
    print('you entered a lowercase letter')
elif x >= '1' and x <= '8':
    print('you entered an integer')
else:
    print('you entered a special character')

when i give input 21,77,11 or any such number it gives the output "you entered an integer" but when i enter any number like 80, 81, 87 (number starting with 8) it displays "you entered a special character".

why i get such output?

Aucun commentaire:

Enregistrer un commentaire