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
______
| /
| /
| /
| /
|/
1
Expert's answer
2021-08-19T14:31:29-0400
n = int(input('Please enter a positive integer: '))
for i in range(n):
print("_", end='')
print()
for i in range(n+1):
for j in range(n-i):
if(j == 0):
print("|",end='')
if(j == n-i-1):
print("/", end='')
else:
print(" ", end='')
print()
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments