fork download
  1. secret = "test"
  2. wrongCount = 0
  3. maxWrongGuess = 7
  4. while True:
  5. guess = str(input('Guess letter: '))
  6. if (guess in secret):
  7. print(guess + " was in the word!")
  8. secret = ''.join(secret.split(guess))
  9. else:
  10. print("Not in word")
  11. wrongCount += 1
  12. if (len(secret) == 0):
  13. print("You won!")
  14. break
  15. if (wrongCount >= maxWrongGuess):
  16. print("You're literal garbage")
  17. break
Runtime error #stdin #stdout #stderr 0.01s 9992KB
stdin
Standard input is empty
stdout
Guess letter: 
stderr
Traceback (most recent call last):
  File "./prog.py", line 5, in <module>
EOFError: EOF when reading a line