write a program to print numbers from 1 to N in each row forming a square pattern of N rows and M columns
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()
Comments
Leave a comment