import random x = random.randrange(10) + 1 y = '' count = 0 while y != x: y = int(raw_input('I\'ve picked a number. Make a guess!\n')) print 'Wrong guess!' count += 1 print count raw_input('\n\nP')
6
I've picked a number. Make a guess! Wrong guess! I've picked a number. Make a guess!
Traceback (most recent call last): File "prog.py", line 6, in <module> EOFError: EOF when reading a line