编辑代码

def nonRecursivePrint(n):
    for i in range(1, n+1):
        row = [str(i)] * i
        print(" ".join(row))

n = 6
nonRecursivePrint(n)