How to print in the same line in python?
In any programming language, printing output is a most important task. In python also printing output is the most important task.
Printing output in the same line is also a task in python.
We have some methods by which we can do that.
e.g.,
print("hello, world!", end='') print("Welcome to Pythonpoint.")
output - hello, world! Welcome to Pythonpoint.
We have another method to do this.
e.g.,
import sys sys.stdout.write("Hello, world!") sys.stdout.write("Welcome to pythonpoint.")
output - Hello, World! Welcome to pythonpoint.
This is how we can print in the same line in python.
Subscribe
Login
Please login to comment
0 Discussion