In python 2, using a comma operator at the end of the statement to print the output in horizontal line. Like this:
for i in range(5):
print i,
And Above code would generate the following output:
0 1 2 3 4
But, in Python 3 comma operator not work to print the output in horizontal line.
for i in range(5):
print (i),
Generate the following output:
0
1
2
3
4
So, How to print output in horizontal line in python 3?