Answer to Question #327897 in Python for chinna

Question #327897

m rows, n columns:



input:

3,3


output:

1 2 3

4 5 6

7 8 9


1
Expert's answer
2022-04-13T16:05:05-0400
m = int(input("Enter number of lines: "))
n = int(input("Enter number of columns: "))

for i in range(1, m * n + 1):
    if i % m == 0:
        print(i)
    else:
        print(i, end=' ')

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS