0
Why in the below program the output is not 12345 instead the output is displayed in separate lines?
i = 1 while i <=5: print(i) i = i + 1
2 Answers
+ 7
In python, The print() includes 'new line'.
if you don't want 'new line', rewrite as follows
print(i, end='')
+ 1
As rightly said print() creates a new line and if you want to display the output in the same line just add a comma after the entire print statement.