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=" ")
@hadideyal9377 Жыл бұрын
How nice to see your lectures, everything is explained in a clear and orderly way, thank you sir, bless you...
@rajeshprajapati1851 Жыл бұрын
Hats off to their presentation skills.
@Efe-hc6kx9 ай бұрын
Great method to teaching ,thanks a lot
@UsmanAliAli-od7eg Жыл бұрын
Thanks you dear jaspreet sing sir from Pakistan 🇵🇰🇵🇰❤❤and long live for jaspreet sing sir from