Condition with letter in Python

1

I want to be a simple example of:

test = input('Letra: ')

If the letter you typed is 'a' (here I have a problem)

print('exemplo')

I want you to see a message when you type "a" ..........

    
asked by anonymous 23.04.2018 / 21:44

1 answer

1

I do not quite understand what you have to do. Do you want to print only if the character you received is the letter "a"?

If so, try:

test = input("Letra: ")
if(test == 'a'):
    print("mensagem")
    
23.04.2018 / 22:11