On Tue, Dec 28, 2010 at 2:54 PM, Enih Gilead <[email protected]> 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?
>
If you put commas between things in a print statement, python will put
a space in between. Either use string formatting or convert to str()
and add together:
print "{0}{1}".format(a, b),
print str(a) + str(b),
Hugo
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor