Answer to Question #221747 in Python for Hari nadh babu

Question #221747
Number Diamond

This Program name is Number Diamond. Write a Python program to Number Diamond


The below link contains Sum of Even numbers question, explanation and test cases


https://drive.google.com/file/d/1zwyt_70X9gnXDtzKcW8GEDy9Mlin459f/view?usp=sharing


We need exact output when the code was run
1
Expert's answer
2021-08-01T00:29:41-0400
N = int(input());


for i in range(1,N+1):
    for j in range(N,i,-1):
        print(" ",end="")
    for k in range(1,i+1):
        print(str(k)+" ",end="")
    print("")
for i in range(1,N+1):
    for j in range(1,i+1):
        print(" ",end="")
    for k in range(1,N-i+1):
        print(str(k)+" ",end="")
    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