Help with guessing game :D

Chris Angelico rosuav at gmail.com
Tue Oct 29 07:53:55 EDT 2013


On Tue, Oct 29, 2013 at 10:45 PM, Robert Gonda
<robertgonda1994 at gmail.com> wrote:
> N = raw_input() #What the user's name is
> print(N + ", I'm thinking of a number between 1-1000") #Not needed but tells the user their name and tells them that it's thinking of a number betweeen 1 to 1000
>     guess = input()
>     guess = int(guess)

Which version of Python are you using? The raw_input call is very
Python 2, but you're using print as a function, and then you're
converting input()'s result to an integer, both of which suggest
Python 3.x. If you're using Python 2, do NOT use input() - it is
dangerous, deceptively so. In Python 3, that problem no longer
applies.

ChrisA



More information about the Python-list mailing list