Answer to Question #251612 in Python for Sammy

Question #251612
how to print the following half pyramid pattern of numbers

1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1
Expert's answer
2021-10-15T11:58:23-0400
number = 5


for i in range(number):
    for j in range(i+1):
        print(j+1,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