Shaded Diamond
Given an integer value
The first line of input is an integer
In the given example
N = 5. Therefore, the output should be
*
* *
* * *
* * * *
* * * * *
* *
* *
* *
*
Sample Input 1
6
Sample Output 1
*
* *
* * *
* * * *
* * * * *
* * * * * *
* *
* *
* *
* *
*
Sample Input 2
5
Sample
N = int(input('Enter input here: '))
for i in range(1,2*N):
if i == 1 or i == (2 * N) - 1:
print('*')
elif i <= 5:
print('*' * i)
else:
print('*' * 2)
Enter input here: 5
*
**
***
****
*****
**
**
**
*
Comments
Leave a comment