On Wed, Sep 11, 2013, at 07:36 AM, Wayne Werner wrote: > On Sat, 31 Aug 2013, candide wrote: > > # ----------------------------- > > for i in range(5): > > print(i, end=' ') # <- The last ' ' is unwanted > > print() > > # ----------------------------- > > Then why not define end='' instead?
I think the OP meant that ' ' is wanted up until the final item.. so something like for i in range(4): print(i, end=' ') print(4) or, better: print(' '.join(str(i) for i in range(5))) -- https://mail.python.org/mailman/listinfo/python-list