fork download
  1. #computer picks a random word among given tuple
  2. #input plaer
  3. #comparison
  4. #loop comparison
  5. #computer tells the number of letters
  6. #five guesses of LTTR
  7. #comparison result is printed as yes or no
  8. #then to guess a whole word
  9.  
  10. s = ('seo', 'heno', 'reno', 'veno', 'teno')
  11. import random
  12. v = random.choice(s)
  13. print 'I\'ve picked a word. It\'s length is', len(v)
  14. guess = None
  15. guesscount = 0
  16. while True:
  17. if guess != '':
  18. guess = raw_input('Try your letter\n')
  19. guesscount += 1
  20. if guess not in v:
  21. print 'Nope'
  22. if guess in v:
  23. print 'Yes'
  24. if guesscount == 3:
  25. print 'Thats all your tries, now time for final dish'
  26. break
  27. m = raw_input('Okay now try to guess a word')
  28. if m == v:
  29. print 'Omedeto'
  30. else:
  31. print 'sry just no'
  32.  
  33. raw_input('\n\nP')
Runtime error #stdin #stdout #stderr 0.01s 10040KB
stdin
Standard input is empty
stdout
I've picked a word. It's length is 4
Try your letter
stderr
Traceback (most recent call last):
  File "prog.py", line 18, in <module>
EOFError: EOF when reading a line