How to print square pattern like this.
When input=4.
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
a = int(input()) count = 1 for i in range(a): lst = [str(i) for i in range(count, count + a)] count += a print(" ".join(lst))
Need a fast expert's response?
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Comments
Leave a comment