Answer to Question #278839 in Python for saivarun

Question #278839

inpurt m = 5 (rows)

n = 10 (start from 10)



print....


24

23 22

21 20 19

18 17 16 15

14 13 12 11 10


1
Expert's answer
2021-12-12T12:19:03-0500
N=int(input())
K=int(input())
counter=N-1
for i in range(K):
    for j in range(i+1):
        counter+=1
for i in range(K):
    for j in range(i+1):
        print(counter,end=" ")
        counter-=1
    print()

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS