0

This section is from How to automate the boring stuff chapter 2. I don't understand why this doesn't work, please help.

spam=input()
if spam == 1:
    print('Hello')
elif spam == 2:
    print('Howdy')
else:
    print('Greetings!')

There is no error, but whatever I put, python gives me Greetings! and if I take off the else part, nothing happens. I'm a beginner sorry if it's a stupid question

Lenitux
  • 25
  • 3

1 Answers1

1

convert spam to int

spam = int(spam)
chidimez
  • 141
  • 1
  • 5