I am having trouble with nested loops and lists. I need to print a 2 dimension multiplication table.
mult_table = [
[1, 2, 3],
[2, 4, 6],
[3, 6, 9]
]
print mult_table[0][0],mult_table[0][1],mult_table[0][2]
print mult_table[1][0],mult_table[1][1],mult_table[1][2]
print mult_table[2][0],mult_table[2][1],mult_table[2][2]
1 2 3
2 4 6
3 6 9
this is what i get, but the book wants this output
1 | 2 | 3
2 | 4 | 6
3 | 6 | 9
im not 100% sure how to do this, I know i need to use a loop, but how do i put the vertical dashes in?