fork download
  1. import random
  2. import itertools
  3. x = random.randrange(10) + 1
  4. for count in itertools.count(1):
  5. y = int(raw_input('I\'ve picked a number. Make a guess!\n'))
  6. if y != x:
  7. print 'Wrong guess!'
  8. else:
  9. break
  10.  
  11. print count
  12. raw_input('\n\nP')
Runtime error #stdin #stdout #stderr 0.01s 10088KB
stdin
Standard input is empty
stdout
I've picked a number. Make a guess!
stderr
Traceback (most recent call last):
  File "prog.py", line 5, in <module>
EOFError: EOF when reading a line