Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #61037
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Subject | Re: Input without line break, is it possible? |
| Date | 2013-12-04 16:27 +0000 |
| References | <6f831d02-26bf-4e68-a1c6-a9c9e87db1dc@googlegroups.com> <l7njp8$j0l$1@ger.gmane.org> <CAPTjJmpPoMxZgbSg1K6g=xCRyzgtQ2NVfeXL9-eHNpCrqyvhfg@mail.gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3576.1386174486.18130.python-list@python.org> (permalink) |
On 04/12/2013 16:14, Chris Angelico wrote: > On Thu, Dec 5, 2013 at 3:04 AM, Mark Lawrence <breamoreboy@yahoo.co.uk> wrote: >> On 04/12/2013 15:38, geezle86@gmail.com wrote: >>> >>> The source code: >>> >>> for i in range(8): >>> n = input() >> >> Yes you can get them on a single line, see the response from Tim Chase. But >> just to be crystal clear, are you aware that you're getting string >> representations of numbers, and not the numbers themselves? > > Just to clarify, this is assuming that you're using Python 3. Geezle, > if you're using Python 2, you need to not use input() for anything - > use raw_input() instead, which will do what we're describing here. Good point, I saw input() and automatically assumed Python 3, what a sin! The assumption obviously, not Python 3!! > > I yearn for the day when nobody uses Python 2 any more so this doesn't > need to be asked. > I'm contemplating what it would be like migrating code from Python 1.x to Python 4.0, the fun and games that could be :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Input without line break, is it possible? geezle86@gmail.com - 2013-12-04 07:38 -0800 Re: Input without line break, is it possible? Tim Chase <python.list@tim.thechases.com> - 2013-12-04 09:55 -0600 Re: Input without line break, is it possible? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-04 16:04 +0000 Re: Input without line break, is it possible? [correction] Tim Chase <tim@thechases.com> - 2013-12-04 10:07 -0600 Re: Input without line break, is it possible? Chris Angelico <rosuav@gmail.com> - 2013-12-05 03:14 +1100 Re: Input without line break, is it possible? Michael Torrie <torriem@gmail.com> - 2013-12-04 09:23 -0700 Re: Input without line break, is it possible? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-04 16:27 +0000 Re: Input without line break, is it possible? Chris Angelico <rosuav@gmail.com> - 2013-12-05 03:33 +1100 Re: Input without line break, is it possible? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-04 16:36 +0000 Re: Input without line break, is it possible? Michael Torrie <torriem@gmail.com> - 2013-12-05 08:21 -0700
csiph-web