Le 31/08/2013 10:43, Andreas Perstinger a écrit :

> How about
>
>  >>> print(" ".join(str(i) for i in range(5)))
> 0 1 2 3 4
>


Thanks for your answer. The output is stricly the same but the code doesn't suit my needs :

1) I'm porting to Python 3 a Python 2 full beginner course : the learners are not aware of the join method nor the str type nor generators stuff; 2) Your code introduce a (sometimes) useless conversion to str (consider a string instead of range(5)).


--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to