Hi all,
New to these forums, i've just started learning python, and for my class i have one question that i have to do that i understand but aint to sure about what exactly is required.
"Design, code and test a comp program that reads a character entered from the keyboard and then determines whether the character is a letter (i.e. a-z, A-Z). If the character is a letter, the program also determines whether it is uppercase or lowercase.
eg. Output wud be "Char entered is upper/lower case letter " or "Char is not alphabetic".
I have come up with this, but when i enter in a upper case letter it is just reading it as a lower case. I thought python was case sensitive?
x = "a" or "b" or "c" or "d" or "e" or "f" or "g" or "h" or "i" or "j" or "k" or "l" or "m" or "o" or "n" or "q" or "r" or "s" or "t" or "u" or "v" or "w" or "x" or "y" or "z" or "A" or "B" or "C" or "D" or "E" or "F" or "G" or "H" or "I" or "J" or "K" or "L" or "M" or "O" or "P" or "Q" or "R" or "S" or "T" or "U" or "V" or "W" or "X" or "Y" or "Z"
x = raw_input("Enter a keyboard character: ")
if x is "a" or "b" or "c" or "d" or "e" or "f" or "g" or "h" or "i" or "j" or "k" or "l" or "m" or "o" or "n" or "q" or "r" or "s" or "t" or "u" or "v" or "w" or "x" or "y" or "z":
print 'Character entered is an lower case letter'
elif x is "A" or "B" or "C" or "D" or "E" or "F" or "G" or "H" or "I" or "J" or "K" or "L" or "M" or "O" or "P" or "Q" or "R" or "S" or "T" or "U" or "V" or "W" or "X" or "Y" or "Z":
print 'Character entered is an upper case letter'
else:
print 'Character is not alphabetic'
print "program complete"
Cheers