Answer to Question #196875 in Python for Jonathan

Question #196875

Print the following pattern using for loops:

1

1 2

1 2 3

1 2 3 4

1 2 3 4 5


1
Expert's answer
2021-05-23T12:19:03-0400
for r in range(2,7):
    line=""
    for c in range(1,r):
        line += str(c)+ " "
    print(line)

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