def f(n): r = n*n c = 1 for i in range(0, r): print(i, end=" ") if c == n: print() c = 1 c += 1 f(15)