Condition with Python letter

Asked

Viewed 382 times

1

I want just a simple example of:

test = input('Letra: ')

ai if the typed letter is ' a' (here I’m having trouble)

print('exemplo')

I want when I type "a" to appear a message..........

  • 1

    Makes a if checking. You have studied programming logic?

1 answer

1


I don’t quite understand what you want to do. You want to print only if the received character is the letter "a"?

If that’s it, try:

test = input("Letra: ")
if(test == 'a'):
    print("mensagem")

Browser other questions tagged

You are not signed in. Login or sign up in order to post.