5、 编程输出如下图形: * *** ***** ******* ***** *** *
时间: 2023-11-13 18:05:42 浏览: 118
以下是输出该图形的 Python 代码:
```
n = 4
for i in range(n):
print(" "*(n-i-1) + "*"*(2*i+1))
for i in range(n-2, -1, -1):
print(" "*(n-i-1) + "*"*(2*i+1))
```
输出结果为:
```
*
***
*****
*******
*****
***
*
```
阅读全文
相关推荐
![exe](https://img-home.csdnimg.cn/images/20241231044909.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![md](https://img-home.csdnimg.cn/images/20250102104920.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231044736.png)
![-](https://img-home.csdnimg.cn/images/20241231044955.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231044937.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231044955.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)