Answer to Question #284016 in Python for srinu

Question #284016

Given an integer number N as input.write a program to print the hollow rigthangled triangular pattern of N lines as shown below




1
Expert's answer
2022-01-02T02:23:36-0500
def rtriangle(n):
    print('*')
    for i in range(n-2):
        s = '*' + ' '*i + '*'
        print(s)
    print('*'*n)

n = int(input())
rtriangle(n)

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