Right Angled Triangle - 3
Given an integer number
N as input. Write a program to print the right-angled triangular pattern of N rows as shown below.
Input
The first line of input is a positive integer.
Explanation
For example, if the given number is
5, the output should be
______
| /
| /
| /
| /
|/
Sample Input 1
5
Sample Output 1
______
| /
| /
| /
| /
|/
Sample Input 2
7
Sample Output 2
________
| /
| /
| /
| /
| /
| /
|/
N = int(input())
for i in range(N+1):
print('_', end='')
print()
for i in range(N):
print('|', end='')
print(' ' * (N - i - 1), end='')
print('/')
Comments
Leave a comment