fork download
  1. import sys
  2.  
  3. def main():
  4.  
  5. store={'one':1, 'two':2, 'three':3, 'four': 4, 'five' : 5, 'six' : 6,
  6. 'seven' : 7, 'eight' : 8, 'nine' : 9, 'zero' : 0}
  7.  
  8. array=['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight',
  9. 'nine', 'zero']
  10.  
  11. t=int(raw_input())
  12.  
  13. for i in range(t):
  14.  
  15. word=raw_input().strip()
  16. expected=len(word)-1
  17.  
  18. for j in array:
  19. if len(word)==len(j):
  20. match=sum(a==b for a, b in zip(j, word))
  21. if match==expected:
  22. break
  23. print store[j]
  24. main()
  25.  
Success #stdin #stdout 0.01s 9016KB
stdin
3
owe
seren
rix
stdout
1
7
6