Advertisement
Petiasla

9.DigitToWord

Mar 12th, 2022
34
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. digit = input()
  2.  
  3. if digit == float(digit):
  4. print('not a digit')
  5. elif digit == str(digit):
  6. print('not a digit')
  7. digit = int(digit)
  8. elif digit == 1:
  9. print('one')
  10. elif digit == 2:
  11. print('two')
  12. elif digit == 3:
  13. print('three')
  14. elif digit == 4:
  15. print('four')
  16. elif digit == 5:
  17. print('fife')
  18. elif digit == 6:
  19. print('six')
  20. elif digit == 7:
  21. print('seven')
  22. elif digit == 8:
  23. print('eight')
  24. elif digit == 9:
  25. print('nine')
  26. elif digit == 0:
  27. print('zero')
  28. else:
  29. ('not a digit')
  30.  
Advertisement
RAW Paste Data Copied
Advertisement