+ 1

How do you have the user input a number and have the program use a if/elif statement to print something?(python)

30th Sep 2017, 5:04 PM
Mr.BoopyDooper
2 Answers
+ 3
num = int(input()) if num == 5: print("Number is 5") elif num == 11: print("Number is 11") elif num == 7: print("Number is 7") else: print("Number isn't 5, 11 or 7")
30th Sep 2017, 5:07 PM
Rishita
Rishita - avatar
+ 1
thx
30th Sep 2017, 5:09 PM
Mr.BoopyDooper