python first project

ngangsia akumbo ngangsia at gmail.com
Sat Jan 11 11:31:14 EST 2014


On Saturday, January 11, 2014 5:29:39 AM UTC+1, Chris Angelico wrote:
> On Sat, Jan 11, 2014 at 3:18 PM, ngangsia akumbo <ngangsia at gmail.com> wrote:
> 
> >     purch_price = input("Please enter the price for purchase made: ")
> 
> >     purch_p = raw_input("Please enter the reason of this purchase made: ")
> 
> 
> 
> Never use input() in a Python 2 program... always use raw_input()
> 
> instead. You're mostly right, but you have a few cases where you're
> 
> using input(). Probably what you want is int(input()) or
> 
> float(input()).
> 
> 
> 
> Incidentally, is there a strong reason for using Python 2 for this? If
> 
> not, I'd recommend moving immediately to Python 3, as there are an
> 
> increasing number of advantages. Unless something actually binds you
> 
> to Py2, save yourself the trouble of shifting in a few years' time and
> 
> just use Py3 now.
> 
> 
> 
> ChrisA

Thanks for the reply



More information about the Python-list mailing list