Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #The question is "Write code that prints Hello if 1 is stored in spam, prints Howdy if 2 is stored in spam, and prints Greetings! if anything else is stored in spam"
- #My problem is the program ends after returning a response to the user input
- #How do I make it restart by asking the question in a loop?
- print ('What is the value of spam')
- spam = int(input())
- if spam == 1:
- print ('Hello')
- elif spam == 2:
- print ('Howdy')
- else:
- print ('Greetings!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement