Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #63682

Re: python first project

References <ae47738d-b16a-4567-bdd9-07d18db5fc77@googlegroups.com>
Date 2014-01-11 15:29 +1100
Subject Re: python first project
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.5317.1389414582.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Sat, Jan 11, 2014 at 3:18 PM, ngangsia akumbo <ngangsia@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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

python first project ngangsia akumbo <ngangsia@gmail.com> - 2014-01-10 20:18 -0800
  Re: python first project Chris Angelico <rosuav@gmail.com> - 2014-01-11 15:29 +1100
    Re: python first project ngangsia akumbo <ngangsia@gmail.com> - 2014-01-11 08:31 -0800
      Re: python first project Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-11 16:40 +0000
  Re:python first project Dave Angel <davea@davea.name> - 2014-01-11 08:06 -0500
    Re: python first project ngangsia akumbo <ngangsia@gmail.com> - 2014-01-11 08:28 -0800
      Re: python first project Dave Angel <davea@davea.name> - 2014-01-11 19:15 -0500
  Re: python first project Denis McMahon <denismfmcmahon@gmail.com> - 2014-01-11 16:28 +0000
  Re: python first project Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-01-11 12:17 -0500
    Re: python first project ngangsia akumbo <ngangsia@gmail.com> - 2014-01-11 09:55 -0800
      Re: python first project Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-01-11 17:10 -0500
        Re: python first project ngangsia akumbo <ngangsia@gmail.com> - 2014-01-11 21:14 -0800
          Re: python first project Chris Angelico <rosuav@gmail.com> - 2014-01-12 17:04 +1100
            Re: python first project ngangsia akumbo <ngangsia@gmail.com> - 2014-01-11 23:30 -0800
          Re: python first project Emile van Sebille <emile@fenx.com> - 2014-01-12 08:37 -0800
            Re: python first project ngangsia akumbo <ngangsia@gmail.com> - 2014-01-12 08:47 -0800
          Re: python first project MRAB <python@mrabarnett.plus.com> - 2014-01-12 18:50 +0000
      Re: python first project Chris Angelico <rosuav@gmail.com> - 2014-01-12 09:15 +1100
  Re: python first project Wolfgang Keller <feliphil@gmx.net> - 2014-01-11 19:34 +0100

csiph-web