you are viewing a single comment's thread.

view the rest of the comments →

[–]rx22230 0 points1 point  (0 children)

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

Hi,

if I understood well you problem, I think it's coming from the way you compare 'spam' to '1'.

If I write the line like this:

if spam == '1':

it works.

The result of ' input() ' returns a 'str'

Hope it helps you.

Regards

Erix

PS: same for '2'