- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can we combine multiple print statements per line in Python?
You can combine multiple print statements per line using, in Python 2 and use the end argument to print function in Python 3.
example
Python2.x print "Hello", print " world" Python3.x print ("Hello", end='') print (" world")
Output
This will give the output −
Hello world
Another thing you could do is put all the things in an array and call ''.join(array).
example
arr = ["Hello", "world"] print(' '.join(arr))
Output
This will give the output −
Hello world
- Related Articles
- How can we print multiple blank lines in python?
- In MySQL, how we can write Multiple-line statement?
- How do we write Multi-Line Statements in Python?
- How to provide multiple statements on a single line in Python?
- How to combine multiple graphs in Python
- How can we combine functions in MySQL?
- How we can bundle multiple python modules?
- How we can extend multiple Python classes in inheritance?
- Multiple Statements in Python
- While running MySQL statements in batch mode, how can we print, along with output, which statements are getting executed?
- How we can split Python class into multiple files?
- How we can break a string with multiple delimiters in Python?
- Multi-Line Statements in Python
- How can we do Python operator overloading with multiple operands?
- How can we use prepared statements in MySQL?

Advertisements