fork download
  1. print('''Choice your number
  2. [1] Banana
  3. [2] Apple ''')
  4. while True:
  5. option = int(input('Your option: '))
  6. if option == 1:
  7. print('Banana choiced')
  8. break
  9. elif option == 2:
  10. print('Apple choiced')
  11. break
  12. print('Try again')
  13.  
  14. #https://pt.stackoverflow.com/q/257201/101
Success #stdin #stdout 0.04s 9520KB
stdin
4
1
stdout
Choice your number
[1] Banana
[2] Apple 
Your option: Try again
Your option: Banana choiced