Question #348836

write a program to print numbers from 1 to N in each row forming a square pattern of N rows and M columns


Expert's answer

def main():
    try:
        t = int(input('Enter a number: '))
        n = int(input('Number of columns:'))
        for i in range(1, t + 1):
            print(str(i) * n)
    except ValueError:
        print('Numbers only')
        main()
main()

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!

LATEST TUTORIALS
APPROVED BY CLIENTS