How can i impress some variables in the same lane in python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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.

2nd Feb 2017, 11:42 AM
Victor Regueira
Victor Regueira - avatar
3 Answers
+ 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)
2nd Feb 2017, 12:45 PM
visph
visph - avatar
+ 2
print(a, b, c, d) #Use commas in between
2nd Feb 2017, 12:16 PM
Álvaro
+ 2
Thank you.
2nd Feb 2017, 12:30 PM
Victor Regueira
Victor Regueira - avatar