[Tutor] blank space after a number

bob gailer bgailer at gmail.com
Tue Dec 28 20:34:47 CET 2010


On 12/28/2010 8:54 AM, Enih Gilead wrote:
> Hi, Abrahamsen!
>
> Would you mind tell me a way to eliminate the blank space in front of 
> "a" [int number] ?
> Just as an example, the 'a' that is made = to '0', when printed, it 
> comes with a blank space after...
>
> a, b = 0, 1
> while b < 10:
>     print a, b,
>     a, b = a, b + 1
>
> ... do you think is there any reasonable way to transform the '0' 
> number into string and then back to numeral - after the printing action?

Use formatting: print '%i%i' % (a,b)



-- 
Bob Gailer
919-636-4239
Chapel Hill NC



More information about the Tutor mailing list