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
*
* *
* *
* * * *
def right_triangle(n):
print('*')
for i in range(n-2):
print('* *')
print('* '*n)
def main():
n = int(input())
right_triangle(n)
main()
Comments
Leave a comment