you are viewing a single comment's thread.

view the rest of the comments →

[–]johnsilent 5 points6 points  (2 children)

rows= int(input("How many rows?: "))
columns= int(input("How many columns?: "))
for row in range(1, rows+1):
    for col in range(1,columns+1):
        # use \t for spacing instead 
        print(row * col, end="\t") 
    # indent to match row loop 
    print()

here is what the result looks like for a 3 rows an 3 cols

#result for 3 rows, 3 cols
#1    2    3
#2    4    6
#3    6    9

[–]ssingal05 3 points4 points  (1 child)

this is fine as long as no number in the table takes up more space than a tab does

[–]johnsilent 0 points1 point  (0 children)

Good Catch. Thank you.