Digit 9
This Program name is Digit 9. Write a Python program to Digit 9, it has two test cases
The below link contains Digit 9 question, explanation and test cases
https://drive.google.com/file/d/1lqixEtNT6DnFGtmFoJLzQrmvYowmxNqi/view?usp=sharing
We need exact output when the code was run
n = int(input())
line_1 = n * '* '
line_2 = '* ' + (n-2)*' ' + '*'
line_3 = ' '*(n-1) + '*'
print(line_1)
for i in range(n-2):
print(line_2)
print(line_1)
for i in range(n-2):
print(line_3)
print(line_1)
Input 1:
5
Output 1:
* * * * *
* *
* *
* *
* * * * *
*
*
*
* * * * *
Input 2:
4
Output 2:
* * * *
* *
* *
* * * *
*
*
* * * *
Input 3:
10
Output 3:
* * * * * * * * * *
* *
* *
* *
* *
* *
* *
* *
* *
* * * * * * * * * *
*
*
*
*
*
*
*
*
* * * * * * * * * *
Comments
Amazing!
Leave a comment