a = level
program2(level,a,1,2,1)
def program2(level,a,start,stop,row):
if a == level:
for counter in range(start,stop,1):
print(counter,end=" ")
print("")
a += 1
row += 1
program2(level,a,start,stop,row)
elif a>0:
start = stop
stop = stop+row
for counter in range(start,stop,1):
print(counter,end=" ")
print("")
a += 1
row += 1
program2(level,a,start,stop,row)
else:
print("[Complete]")
floyd_triangle(3)
print("-------------------------")
floyd_triangle(5)
No comments:
Post a Comment