Answer to Question #282507 in Python for Teja

Question #282507

Combined right angle triangle:


Sample input: 4


1st half:


1 2 3 4


5 6 7


8 9


10


2nd half:


17 18 19 20


14 15 16


12 13


11


Output should be combined pattern:


Combined pattern:


1 2 3 4 17 18 19 20


5 6 7 14 15 16


8 9 12 13


10 11



1
Expert's answer
2021-12-24T13:48:35-0500
rows = int(input())

print("right angled triangle pattern") 
k = 1
for i in range(1, rows + 1):
    for j in range(1, i + 1):
        print(k, end = '  ')
        k += 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