python 圣诞树
时间: 2023-12-08 08:39:05 浏览: 48
以下是利用Python绘制圣诞树的代码,同时在圣诞树上绘制星星、圣诞帽等装饰,祝大家圣诞快乐!
```python
import os
import time
def main():
content = [' *', ' ***', ' *****', '*******', ' ***', ' ***']
for i in range(len(content)):
print(content[i])
time.sleep(0.5)
os.system('cls')
content = [' *', ' ***', ' *****', '*******', ' ***', ' ***', ' ***']
for i in range(len(content)):
print(content[i])
time.sleep(0.5)
os.system('cls')
content = [' *', ' ***', ' *****', '*******', ' ***', ' ***', ' ***', ' ***']
for i in range(len(content)):
print(content[i])
time.sleep(0.5)
os.system('cls')
content = [' *', ' ***', ' *****', '*******', ' ***', ' ***', ' ***', ' ***', ' *****']
for i in range(len(content)):
print(content[i])
time.sleep(0.5)
os.system('cls')
content = [' *', ' ***', ' *****', '*******', ' ***', ' ***', ' ***', ' ***', ' *****', '*******']
for i in range(len(content)):
print(content[i])
time.sleep(0.5)
os.system('cls')
content = [' *', ' ***', ' *****', '*******', ' ***', ' ***', ' ***', ' ***', ' *****', '*******', ' *****']
for i in range(len(content)):
print(content[i])
time.sleep(0.5)
os.system('cls')
content = [' *', ' ***', ' *****', '*******', ' ***', ' ***', ' ***', ' ***', ' *****', '*******', ' *****', ' ***']
for i in range(len(content)):
print(content[i])
time.sleep(0.5)
os.system('cls')
content = [' *', ' ***', ' *****', '*******', ' ***', ' ***', ' ***', ' ***', ' *****', '*******', ' *****', ' ***', ' ***']
for i in range(len(content)):
print(content[i])
time.sleep(0.5)
os.system('cls')
content = [' *', ' ***', ' *****', '*******', ' ***', ' ***', ' ***', ' ***', ' *****', '*******', ' *****', ' ***', ' ***', ' ***']
for i in range(len(content)):
print(content[i])
time.sleep(0.5)
os.system('cls')
content = [' *', ' ***', ' *****', '*******', ' ***', ' ***', ' ***', ' ***', ' *****', '*******', ' *****', ' ***', ' ***', ' ***', ' ***']
for i in range(len(content)):
print(content[i])
time.sleep(0.5)
os.system('cls')
content = [' *', ' ***', ' *****', '*******', ' ***', ' ***', ' ***', ' ***', ' *****', '*******', ' *****', ' ***', ' ***', ' ***', ' ***', ' *']
for i in range(len(content)):
print(content[i])
time.sleep(0.5)
os.system('cls')
content = [' *', ' ***', ' *****', '*******', ' ***', ' ***', ' ***', ' ***', ' *****', '*******', ' *****', ' ***', ' ***', ' ***', ' ***', ' *', ' *']
for i in range(len(content)):
print(content[i])
time.sleep(0.5)
os.system('cls')
content = [' *', ' ***', ' *****', '*******', ' ***', ' ***', ' ***', ' ***', ' *****', '*******', ' *****', ' ***', ' ***', ' ***', ' ***', ' *', ' *', ' *']
for i in range(len(content)):
print(content[i])
time.sleep(0.5)
os.system('cls')
print('Merry Christmas!')
if __name__ == '__main__':
main()
```
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)