Question #292904

given an integer number N as input. write a program to print the right-angled triangular pattern of N rows as shown below.


Expert's answer

n = int(input('Please enter a positive integer: '))
for i in range(n-1):
    print(' '*(n-1-i),'/',' '*i,'|',sep ='')
# last line print
print('/','_'*(n-1),'|',sep ='')
LATEST TUTORIALS
APPROVED BY CLIENTS