fork download
  1. #player picks random number
  2. #computer tries to guess
  3.  
  4. print 'Pick number between 1 and 10, including 10'
  5. import random
  6. x = random.randrange(11)
  7. print 'Is your number', x, '?'
  8. y = ''
  9. while True:
  10. if y != 'Correct':
  11. y = raw_input('Input whether your guessed number is \'Correct\', \'Higher\', \'Lower\' \n')
  12. if y == 'Lower':
  13. x -= 1
  14. print 'Is your number', x, '?'
  15. elif y == 'Higher':
  16. x += 1
  17. print 'Is your number', x, '?'
  18. elif y == 'Correct':
  19. print 'Good game'
  20. break
  21. raw_input('\n\nPress \'Enter\' to exit')
  22. # your cock goes here
Runtime error #stdin #stdout #stderr 0.01s 10088KB
stdin
Standard input is empty
stdout
Pick number between 1 and 10, including 10
Is your number 2 ?
Input whether your guessed number is 'Correct', 'Higher', 'Lower' 
stderr
Traceback (most recent call last):
  File "prog.py", line 11, in <module>
EOFError: EOF when reading a line