Hey people! Im new to the community, i will contribute with doubts hehe, so i have this list of lists:

TABLE =[["_","_","_"],
         ["_","_","_"],
         ["_","_","_"]]

i want to print it so it looks something like this:

1 2 3
_ _ _
_ _ _
_ _ _

how can i give it that format? Thanks

One of the many ways ...

table =[
["_","_","_"],
["_","_","_"],
["_","_","_"]
]

header = [1, 2, 3]
sf = "{} {} {}"
print(sf.format(*header))
for line in table:
    print(sf.format(*line))
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.