Printing values in a vertical column format in Python

Question:

Is there a way to print the values of list A in a vertical column format? I present the current and expected outputs.

A=[0.021090000000000005, 0.019535125946503053, 0.019398647830541613]
print(A)

The current output is

[0.021090000000000005, 0.019535125946503053, 0.019398647830541613]

The expected output is

[0.021090000000000005, 
0.019535125946503053, 
0.019398647830541613]
Asked By: user19862793

||

Answers:

You can do this:

a = [1, 2, 3, 4]
for c in a:
    print(c)
Answered By: Chandler Bong

You can always use the print function to format your output as you want.

print(*A, sep='n')

This will add a newline after each element.

Answered By: user19968717
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.