Answer to Question #287280 in Python for Suganya

Question #287280

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 postive integer .

Explanation

For example the given number is 5 .

the output should be

______

|   /

|   /

|  /

| /

|/


1
Expert's answer
2022-01-13T07:47:50-0500
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('/

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS