Digit 9
You are given
The first line of input is an integer
In the given example,
N = 4.So, the output should be
* * * *
* *
* *
* * * *
*
*
* * * *
Sample Input 1
4
Sample Output 1
* * * *
* *
* *
* * * *
*
*
* * *
Sample Input 2
5
Sample Output 2
* * * * *
* *
* *
* *
* * * * *
*
*
*
* * * * *
N = int(input())
first_line = '*' * N
first_line = ' '.join(first_line)
nine = first_line
for i in range(N - 2):
nine += '\n' + '*' + (' ' * (2*N - 3)) + '*'
nine += '\n' + first_line
for i in range(N - 2):
nine += '\n' + (' ' * (2*N - 2)) + '*'
nine += '\n' + first_line
print(nine)
Comments
Leave a comment