Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #54527
| References | <05bbf1a3-6480-48ee-8984-2482b90c79c0@googlegroups.com> |
|---|---|
| Date | 2013-09-21 12:50 +1000 |
| Subject | Re: Print statement not printing as it suppose to |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.212.1379731840.18130.python-list@python.org> (permalink) |
On Sat, Sep 21, 2013 at 7:57 AM, Sam <anasdahany@gmail.com> wrote:
> car=int(input("Lamborghini tune-up:"))
> print("\nThe total amount required is ", total )
> OUTPUT
> ('\nThe total amount required is ', 3534)
As others have said, this output indicates that you're running under a
Python 2.x interpreter. I strongly recommend you switch to running
under Python 3.x - do not take the simple advice that might make it
work in both, because you have other differences which will trip you
up. In Python 2, the input function is extremely dangerous and should
be avoided: it *evaluates* its argument. (If you really *want* to
evaluate something, you can call the eval() function explicitly. You
don't want it to be hidden behind the innocuously-named input().)
Download Python 3.3 (or later) and start using that; you'll find it's
by far the better interpreter - years of improvements on top of the
version you're using there.
ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Print statement not printing as it suppose to Sam <anasdahany@gmail.com> - 2013-09-20 14:57 -0700 Re: Print statement not printing as it suppose to Tim Delaney <timothy.c.delaney@gmail.com> - 2013-09-21 08:11 +1000 Re: Print statement not printing as it suppose to Emiliano Carlos de Moraes Firmino <emiliano.firmino@gmail.com> - 2013-09-20 18:11 -0400 Re: Print statement not printing as it suppose to John Gordon <gordon@panix.com> - 2013-09-20 22:40 +0000 Re: Print statement not printing as it suppose to Chris Angelico <rosuav@gmail.com> - 2013-09-21 12:50 +1000 Re: Print statement not printing as it suppose to Dave Angel <davea@davea.name> - 2013-09-21 04:40 +0000
csiph-web