from turtle import * color("black","red") begin_fill() pu() fd(-200) pd() seth(30) fd(300) seth(-90) fd(300) seth(150) fd(300) end_fill() pu ...
.六角形的繪制 思路:一個六角形可以看作是兩個等邊三角形具有共同的中心且垂線互成 角。所以只需實現一個等邊三角形的繪制以及第二個三角形繪制起點的移動即可。 代碼如下: import turtleturtle.setup , , , turtle.penup turtle.pensize turtle.pencolor red turtle.fd turtle.seth turtle.pendow ...
2019-09-11 19:04 2 4906 推薦指數:
from turtle import * color("black","red") begin_fill() pu() fd(-200) pd() seth(30) fd(300) seth(-90) fd(300) seth(150) fd(300) end_fill() pu ...
六角形的繪制 描述 使用turtle庫繪制一個六角形,效果如下: ...
import turtle turtle.left(30)turtle.forward(144) turtle.right(60)turtle.forward(144) turtle.right(60)turtle.forward(144 ...
只好這樣霸王硬上弓了,不知道有沒有更好的辦法,但沒搜到還VIP付費。。。。 然后遇到了八角形的繪制,卻想不出兩者有何異曲同工之妙。 但在確定循環左轉角度的時候,愣了一下,哈哈哈哈,看來我初中數學還需要回爐重造 其實這樣看就豁然開朗: 轉向2次,就從絕對角 ...
多試錯,反正又不要成本。 import turtle a = 1 for i in range(50): turtle.left(90) turtle.fd(a+1) turtle.left(90) turtle.fd(a+2 ...
1 安裝turtle Python2安裝命令: Python3安裝命令: 因為turtle庫主要是在Python2中使用的,所以安裝的時候可能會提示錯誤: Command "python setup.py egg_info" failed ...