How can i print the outputs from a for loop on different lines rather than in a single line? Python 3

Viewed 9

i have only started to learn programming and now i am learning for loop in python I want to print my outputs in different files like:

> 2 4 8 6 10 12 . .

rather than printing like:

> 2
  24 
  246 
  2468
  246810
1 Answers

You can add end=' ' to print of python example:

for i in range(50):
    print(i, end=' ')
Related