![图片[1]-如何用python画六边形?-uusu优素-乐高,模型,3d打印,编程](http://uusucn.zbbe.cn/wp-content/uploads/2024/01/5ee9dec58fafa376.jpg)
用Python编写六边形的步骤:
1、首先加载turtle模块,这个模块是Python自带的模块。
importturtle
2、准备一个turtle
t=turtle.Pen()
3、让t前进100个像素;
t.forward(100)
再让t向左旋转60°;
t.left(60)
4、让步骤3重复六次:
foriinrange(6): t.fotward(100) t.left(60°)原文来自:https://www.py.cn
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END


















































暂无评论内容