Hollow Right Triangle - 2
Given an integer number
The first line of input is an integer
In the given example the hollow right angled triangle of side
5. Therefore, the output should be
*
* *
* *
* *
* * * * *
Sample Input 1
4
Sample Output 1
*
* *
* *
* * * *
Sample Input 2
5
Sample Output 2
*
* *
* *
* *
* * * * *
n = int(input("Enter a number: "))
counter = 0
while counter < n:
counter += 1
if counter == 1:
print("* ")
elif counter == n:
print("* " * n)
else:
print("* *")
Comments
Leave a comment