I don't know what's wrong in this code. I want this program to print the character or to show a message, for example "you didn't type only 1 character". Can you help me please ?
def PrintVariable(lit):
variable = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
"n", "o", "p", "q", "r", "s", "t", "u", "w", "x", "y", "z"]
for i in variable:
if(i == lit):
print("Your character is ", i)
def CheckIfLitIsNumber(lit):
numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
for z in numbers:
if (z == lit):
return True
else:
return False
lit = (input("Give a character "))
if len(lit) == 1 and (CheckIfLitIsNumber(lit) is False):
PrintVariable(lit)
else:
print("You didn't give a character or you've entered a word")