(Very Newbie) Problems defining a variable

Lie Ryan lie.1296 at gmail.com
Fri Dec 12 22:00:38 CET 2008


On Fri, 12 Dec 2008 09:50:43 -0800, Dennis Lee Bieber wrote:

> On Fri, 12 Dec 2008 03:42:55 -0800 (PST), febaen at gmail.com declaimed the
> following in comp.lang.python:
> 
>> #!/usr/bin/python
>> #Py3k, UTF-8
>> 
>> bank = int(input("How much money is in your account?\n>>")) target =
>> int(input("How much money would you like to earn each year? \n>>"))
>> 
> 	Just for my curiosity -- did Python 3.x (besides turning print 
into
> a function) also change input() to behave as the old raw_input()?
> 
> 	The above would be very discouraged in Python 2.x... in favor 
of ...
> int(raw_input(...))
> 

Actually, that's the first thing I wanted to bark on, before seeing the 
little note above it: "#Py3k, UTF-8". I wonder though, there is a 
potential problem if someone (users) is running this py3k code in a 
python2.x. The code is a perfectly legal and correct python 2.x code, but 
uses input() instead of raw_input(), we all know the evil of 2.x's input
().




More information about the Python-list mailing list