Python turtle code Daquan nautilus, python turtle drawing simple code

Hello everyone, the editor is here to answer the following questions for you, how to open the turtle program in python, python turtle code encyclopedia Super Wings, let us take a look now!

 

Expand All

# coding:utf-8

import turtle as t

# draw piggy 5261 page

# =======================================

t.pensize(4)

t.hideturtle()

t.colormode(255)

t.color((255, 155, 192), "pink")

t.setup(840, 500)

t.speed(10)

# nose

t.pu()

t.goto(-100, 100)

t.pd()

t.seth(-30)

t.begin_fill()

a = 0.4

for i in range(120):

if 0 <= i < 30 or 60 <= i < 90:

a = a + 0.08

t.lt(3) # turn left 3 degrees 4102

t.fd(a) # step forward a

else:

a = a - 0.08

t.lt(3)

t.fd(a)

t.end_fill()

t.pu()

t.seth(90)

t.fd(25)

t.seth(0)

t.fd(10)

t.pd()

t.pencolor(255, 155, 192)

t.seth(10)</

Guess you like

Origin blog.csdn.net/mynote/article/details/132405157