print a variable without newline or space python3 does it by print (x,end='') how to do it in python 2.5
sys.stdout.write
writes (only) strings without newlines unless specified.
>>> x = 4
>>> print x
4
>>> import sys
>>> sys.stdout.write(str(x)) # you have to str() your variables
4>>> # <- no newline
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With