+ 1
How can i impress some variables in the same lane in python?
I need to impress like 1 or 4 different things with more than one "print" un the same lane.
3 ответов
+ 4
In Python 3.x you can add a named parameter at argument:
print('what I want whithout line break ending', end='')
You can make it work in Python 2.x ( else you can 'import sys' and use 'sys.stdout.write()' function, but need to call 'sys.stdout.flush()' ) by importing print function from Python3:
from __future__ import print_function
If you are having troubles with buffering, you can force the flush:
print('some string', end='', flush=True)
+ 2
print(a, b, c, d) #Use commas in between
+ 2
Thank you.