Python Forum

Full Version: Multiplication Table code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello guys I need some help with my code.
I tried to do a multiplication table.
But I have no idea how do I move a table from the bottom to the side.
I added some graphical description of how i want to see the finale result.

My code Now.png is the attachment of what I got now.

Multiplication_table.png is the attachment of what i want to get.

Does someone have any idea of how to manipulate the tables view
Is this a homework assignment where you are supposed to figure out how to print tabular data, or can you use Python libraries that make printing tabular data simple?
Hi @alexsendlegames100 ,
Please show your code, then we can see what has to be changed.
Remember you can only print one line at a time, so you may have to change the order in which you do things.
You also want bars ( | ) to separate the tables, so you need to implement fixed width, like:
print(f"{number:2}")
... to make number occupy 2 characters.
In addition to ibreeden's advice, you could use unicode's box drawing characters to make the output look like the one in the picture.