in a single loop : k - to track row l1 - to know when to move new line l2 - multiplication increment print('enter the rows') rows = int(input()) total = rows * (rows + 1) // 2 k = 1 l1 = 1 l2 = 1 for i in range(1, total + 1): l1 = k * (k + 1) // 2 print(k * l2, end = " ") l2 = l2 + 1 if(l1 == i): k = k + 1 l2 = 1 print(' ', end=" ")
How nice to see your lectures, everything is explained in a clear and orderly way, thank you sir, bless you...
in a single loop :
k - to track row
l1 - to know when to move new line
l2 - multiplication increment
print('enter the rows')
rows = int(input())
total = rows * (rows + 1) // 2
k = 1
l1 = 1
l2 = 1
for i in range(1, total + 1):
l1 = k * (k + 1) // 2
print(k * l2, end = " ")
l2 = l2 + 1
if(l1 == i):
k = k + 1
l2 = 1
print(' ', end="
")
Hats off to their presentation skills.
Great method to teaching ,thanks a lot
Thanks you dear jaspreet sing sir from Pakistan 🇵🇰🇵🇰❤❤and long live for jaspreet sing sir from
❤❤🎉❤❤❤
🎉❤