print range in python3.3

Ian Kelly ian.g.kelly at gmail.com
Sun Jan 5 04:16:59 EST 2014


On Jan 5, 2014 1:04 AM, "Mark Lawrence" <breamoreboy at yahoo.co.uk> wrote:
>
> On 05/01/2014 07:38, luofeiyu wrote:
>>>>>
>>>>> range(1,10)
>>
>> range(1, 10)
>>>>>
>>>>> print(range(1,10))
>>
>> range(1, 10)
>>
>> how can i get 1,2,3,4,5,6,7,8,9 in python3.3 ?
>>
>
> for i in range(1,10):
>     print(i, end=',')
> print()
>
> I hope you can cope with the comma at EOL :)

print(*range(1, 10), sep=',')
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20140105/3a04bf22/attachment.html>


More information about the Python-list mailing list