Input without line break, is it possible?

Mark Lawrence breamoreboy at yahoo.co.uk
Wed Dec 4 11:04:00 EST 2013


On 04/12/2013 15:38, geezle86 at gmail.com wrote:
> The source code:
>
> for i in range(8):
>     n = input()
>
> When we run it, consider the numbers below is the user input,
>
> 1
> 2
> 3
> 4
> 5
> 6
> (and so forth)
>
> my question, can i make it in just a single line like,
>
> 1 2 3 4 5 6 (and so forth)
>
> Can I?
>

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?

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence




More information about the Python-list mailing list