Commit 3026e69a by BellCodeEditor

save project

parent 5cfe943c
Showing with 225 additions and 0 deletions
def new_input():
total = []
while True:
unit = input('请输入(q退出):')
if unit == 'q':
break
else:
total.append(unit)
print(total)
new_input()
\ No newline at end of file
import turtle
import turtle
s = turtle.Screen()
s.bgcolor("lightblue")
a = turtle.Pen()
a.pensize(5)
a.speed(9)
a.hideturtle()
a.color('red')
a.up()
a.goto(100,-50)
a.fillcolor('red')
a.begin_fill()
a.setheading(-75)
a.down()
a.forward(140)
a.setheading(180)
a.forward(200)
a.setheading(75)
a.forward(140)
a.end_fill()
a.color('pink')
a.up()
a.goto(-37,-90)
a.down()
a.setheading(150)
a.forward(60)
a.up()
a.goto(109,-90)
a.down()
a.setheading(30)
a.forward(60)
turtle.done()
\ No newline at end of file
from turtle import *
from turtle import *
title("小猪佩奇")
def nose(x,y):
'''画鼻子'''
pensize(5)
pencolor(255,155,192)
penup()
#将海龟移动到指定坐标
goto(x,y)
pendown()
#设置海龟的方向(0-东、90-北、180-西、-90-南)
setheading(-30)
begin_fill()
fillcolor(255,192,203)
a = 0.4
for i in range(120):
if 0 <= i < 30 or 60 <= i < 90:
a +=0.08
left(3)
forward(a)
else:
a -= 0.08
left(3)
forward(a)
end_fill()
penup()
setheading(90)
forward(25)
setheading(0)
forward(10)
pendown()
'''设置画笔颜色(红,绿,蓝)'''
pencolor(255,155,192)
setheading(10)
begin_fill()
circle(5)
color(160,82,45)
end_fill()
penup()
setheading(0)
forward(20)
pendown()
pencolor(255,155,192)
setheading(10)
begin_fill()
circle(160,82,45)
end_fill()
def head(x,y):
'''画头'''
color('pink')
penup()
goto(x,y)
setheading(0)
pendown()
begin_fill()
setheading(180)
circle(300,-30)
circle(100,-60)
circle(80,-100)
circle(150,-20)
circle(60,-95)
setheading(161)
circle(-300,15)
penup()
goto(-100,100)
pendown()
setheading(-30)
a += 0.4
for i in range(60):
if 0 <= i < 30 or 60 <= i < 90:
a += 0.08
left(3)
forward(a)
else:
a -=0.08
left(3)
forward(a)
end_fill()
def ears(x,y):
'''画耳朵'''
color((255,155,192),'pink')
penup()
goto(x,y)
pendown()
begin_fill()
setheading(100)
circle(-50,50)
circle(-10,120)
circle(-50,54)
end_fill()
penup()
setheading(90)
forward(-12)
setheading(0)
forward(30)
pendown()
begin_fill()
setheading(90)
circle(-50,50)
circle(-10,120)
circle(-50,56)
end_fill()
def eyes(x,y):
'''画眼睛'''
color((255,155,192),'white')
penup()
setheading(90)
forward(-20)
setheading(0)
forward(-95)
pendown()
begin_fill()
circle(15)
end_fill()
color('black')
penup()
setheading(90)
forward(12)
setheading(0)
forward(-3)
pendown()
begin_fill()
circle(3)
end_fill()
corcle((255,155,192),'white')
penup()
setheading(90)
forward(-25)
setheading(0)
forward(40)
pendown()
begin_fill()
circle(15)
end_fill()
color('black')
penup()
setheading(90)
forward(12)
setheading(0)
forward(-3)
pendown()
begin_fill()
circle(3)
end_fill()
def cheek(x,y):
'''画脸颊'''
color(255,155,192)
penup()
goto(x,y)
pendown()
setheading(0)
begin_fill()
circle(30)
end_fill()
def main():
nose(-100,100)
head(-69,167)
ears(0,160)
if __name__=='__main__':
main()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment