Printing a table in Python
问题 I have an assignment to create a 10 by 10 table in Python and I'm using the end "\t" within my print function to prevent it from creating a new line. But, I need it to start a new line after of course 10 characters. How can I make it do that? Here's my code: product = 0 for x in range(1,11): for y in range(1,11): product = x * y print(product, end="\t") I need it to look something like this: 1 2 3 4 5 6 ... 2 4 6 8 10 12 ... 3 6 9 12 15 18 ... 回答1: This is using alignement options from the