From: Jerry Hill on 18 Sep 2009 16:26 On Fri, Sep 18, 2009 at 4:16 PM, koranthala <koranthala(a)gmail.com> wrote: > What if I want to print 1 to 100 in a loop without spaces in between? > I think that is the OPs question. In that case I would skip using print entirely, and use something like this: import sys for i in xrange(100): sys.stdout.write(str(i)) sys.stdout.write('\n') That allows you to bypass any of the behavior of the print builtin that you don't want. -- Jerry
From: Wolfgang Rohdewald on 18 Sep 2009 16:31 On Friday 18 September 2009, koranthala wrote: > What if I want to print 1 to 100 in a loop without spaces in > between? I think that is the OPs question. arr = ['a', 'b', 'c', 'andsoon'] print ''.join(arr) -- Wolfgang
First
|
Prev
|
Pages: 1 2 Prev: Looking for a pure Python chart drawing module Next: pygame and py2app : big package |