The output should be N lines containing the triangle pattern. Explanation For example,if the given number is 5,the pattern should be printed in 5 lines,as shown below
n = int(input())
for i in range(n):
print((n - i) * ' ' + '/', end='')
if i < n - 1:
print(' ' * i, end='')
else:
print('_' * i, end='')
print('|')
Comments
Leave a comment