Python3之turtle模块的使用 直接扣代码就行: import turtle as t t.pensize(4) t.hideturtle() t.colormode(255) t.color((255, 155, 192), "pink") t.setup(840, 500) t.speed(10) # 鼻子 t.pu() t.goto(-100, 100) t.pd() t.seth(-30) t.begin_fill() a = 0.4 for i in rang
系统环境 ubuntu18 4.1turtle模块 模块一开始导入turtle模块就报错了 Python ( , ::) [GCC ] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import turtle Traceback (most recent call last): File
python3 turtle 画国际象棋棋盘 #!/usr/bin/env python # -*- coding:utf-8 -*- # Author:Hiuhung Wan import turtle n = 60 # 每行间隔 x = -300 # x初始值 y = -300 # x初始值 turtle.speed(11) turtle.pensize(2) # 先画8*8的正方形,并按要求涂黑 for i in range(8): for j in range(1, 9): turtle
python3 环境 利用turtle模块画出 围棋棋盘 #!/usr/bin/env python # -*- coding:utf-8 -*- # Author:Hiuhung Wan import turtle n = 30 #两条线间隔 x = -300 # x初始值 y = -300 # y初始值 turtle.speed(9) turtle.screensize(400, 400) turtle.penup() turtle.pencolor('black') for i in ra
import turtle as t t.speed(10) t.pencolor("yellow") t.fillcolor("red") for num in range(1,6): for i in range(1,5): t.forward(200) t.right(144) t.forward(200) t.goto(num*50,num*50) t.penup() t.goto(-100,-200) t.color('green','red') for