Answer to Question #292505 in Python for Sai

Question #292505

Given an integer N as input. Write a program the yellow right-angle pattern of N lines as bellow.



Note:There is a space after each asterisk (*) Character.



Input



The first line is an integer N



Explanation



In the given example the yellow right angled triangle of side 5 .Therefore, the output should be.



*



* *



* *



* *



* * * * *



Sample Input 1



4



Sample Output 1



*



* *



* *



* * * *




1
Expert's answer
2022-01-31T16:18:19-0500
def right_triangle(n):
    print('*')
    for i in range(n-2):
        print('* *')
    print('* '*n)

def main():
    n = int(input())
    right_triangle(n)

main()

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