arahpaul

If_else_Devendra

Nov 10th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. print("1. Oranges")
  2. print("2. Apples")
  3. print("3. Lemons")
  4. print("4. Banana")
  5.  
  6. fruit_choice = int(input("Input a corresponding number to choose a fruit "))
  7.  
  8. if fruit_choice == 1:
  9.     print("You choosed orange. Thank you!")
  10. else:
  11.     if fruit_choice == 2:
  12.         print("You choosed Apples. Thank you!")
  13.     else:
  14.         if fruit_choice == 3:
  15.             print("You choosed lemons. Thank you!")
  16.         else:
  17.             if fruit_choice ==  4:
  18.                 print("You choosed Banana. Thank you!")
  19.             else:
  20.                 print("Invalid choice!\n Please Input a number that corresponds to a fruit!")
Add Comment
Please, Sign In to add comment