[Tutor] Class methods

Alan Gauld alan.gauld at btinternet.com
Thu Jun 23 03:16:20 CEST 2011


"michael scott" <jigenbakuda at yahoo.com> wrote 

> you are using python 3 by your print statements, so I 
> don't think you need the int() around your input, 

Yes he does because in Python 3 input is the same as raw_input 
in Python 2

> even in python.2x input() was safe for numbers I believe 
> (the whole list will rip my throat out if I'm wrong anyways

rip, rip, rip. :-)
In Python 2 input could be used for numbers but it was 
not "safe", which is why input was effectively removed 
in Python 3 and raw_input renamed to input. In Python 2 
input() evaluated whatever was typed as a Python expression 
which made it very unsafe. 


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/




More information about the Tutor mailing list