-->
当前位置:首页 > 题库

PROGRAMMING:Display diamond shape

Luz5年前 (2021-05-10)题库464
The diamond shape is displayed, and the width of each line is 11.
###Input format:
Enter the number of rows to be displayed. The number of rows is in '1,3,5,7,9,11'
###Output format:
Diamond shape, the width of each line is 11
###Input sample 1:
Here is a set of inputs. For example:
```in
five
```
###Output sample 1:
The corresponding output is given here. For example:
```out
*
***

***
*
```
###Input sample 2:
Here is a set of inputs. For example:
```in
eleven
```
###Output sample 2:
The corresponding output is given here. For example:
```out
*
***

**
****
*
****
**

***
*
```







answer:If there is no answer, please comment
```
m=int(input())
for row in range (1,m+1,2):
print('{:^11}'.format('*'*row))
for row in range (m-2,0,-2):
print('{:^11}'.format('*'*row))
```