given an integer number N as input. write a program to print the right-angled triangular pattern of N rows as shown below.
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 ='')
Comments
Leave a comment