Answer to Question #302437 in Python for reyadhh

Question #302437

Write a python program that prints a rectangle of size M (height/line numbers) and N (length/column numbers) using incrementing numbers where M and N will be given as input. Please look at the examples below for clarification.

Hint: You may need to use nested loops and print the loop counter variable in one of the loops.

==========================================================

Sample Input 1:

4

6

Sample Output 1:

123456

123456

123456

123456


1
Expert's answer
2022-02-28T01:04:10-0500
m = int(input('M='))
n = int(input('N='))
for i in range(m):
    for j in range(1, n+1):
        print(j, end='')
    print('')

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