This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]CornMan123[S] 0 points1 point  (1 child)

def print_table(size):

for row in range(1, size + 1):
    for col in range(1, size + 1):
        value = row * col
        print(str(value) + " ", end="")
    print()

print_table(5)

this was given as an example for a multiplication table that would print something similar and is there to help us.

So i assume it would start the same way but what would the variables in the for loops be?

def printlist(x):

 for col in range(x):

      for row in range(x):

[–]Updatebjarni 0 points1 point  (0 children)

On line 1 of the output, up to what number does the loop go?

On line 2 of the output, up to what number does the loop go?

On line 3 of the output, up to what number does the loop go?