Advertisement
Petiasla

9.DigitToWord_2

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