Hollow Right Triangle
Given an integer number
The first line of input is an integer
In the given example the hollow right angled triangle of side
4. Therefore, the output should be
* * * *
* *
* *
*
Sample Input 1
4
Sample Output 1
* * * *
* *
* *
*
Sample Input 2
6
Sample Output 2
* * * * * *
* *
* *
* *
* *
*
N = int(input())
first_line = '* ' * N
middle_line = '* ' * 2
last_line = '* '
output = first_line
for i in range(N - 2):
output += '\n' + middle_line
output += '\n' + last_line
print(output)
Comments
Leave a comment