fork download
  1. # -*- coding: utf-8 -*-
  2. import random
  3. s1 = "konnichiwa"
  4. s2 = 'fuel'
  5. s3= 'desperado'
  6. tuple1 = (s1, s2, s3)
  7. sourceword = random.choice(tuple1)
  8. sourceword1 = sourceword
  9. guessword = ''
  10. while True:
  11. if sourceword != '':
  12. letternumber = random.randrange(len(sourceword))
  13. guessword += sourceword[letternumber]
  14. sourceword = sourceword[letternumber + 1:] + sourceword[:letternumber]
  15. if sourceword == '':
  16. print guessword
  17. break
  18. playerword = raw_input('Enter your guess\n')
  19. playerword = playerword.lower()
  20. while True:
  21. if playerword != sourceword1 or playerword == '':
  22. playerword = raw_input('Wrong. Try again\n')
  23. if playerword == sourceword1:
  24. print 'gratz'
  25. break
  26. raw_input('\n\nPr')
  27. # your code goes here
Runtime error #stdin #stdout #stderr 0.02s 10088KB
stdin
Standard input is empty
stdout
dpsreadeo
Enter your guess
stderr
Traceback (most recent call last):
  File "prog.py", line 18, in <module>
EOFError: EOF when reading a line