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




Expert's answer

def rtriangle(n):
    print('*')
    for i in range(n-2):
        s = '*' + ' '*i + '*'
        print(s)
    print('*'*n)

n = int(input())
rtriangle(n)
LATEST TUTORIALS
APPROVED BY CLIENTS