python基础海归画图题【1.0】

import turtle
import os

turtle.colormode(255)
t=turtle.Turtle()
s=turtle.Screen()
s.bgcolor(70,200,227)
t.speed(0)
#画太阳
t.up()
t.goto(-140,180)
t.setheading(90)
t.begin_fill()
t.fillcolor(237,87,54)
t.down()
t.circle(60)
t.end_fill()
#画云彩1
t.up()
t.goto(250,200)
t.down()
t.begin_fill()
t.fillcolor("white")
t.setheading(-135)
t.circle(70,-80)
t.setheading(-135)
t.circle(30,-150)
t.setheading(-125)
t.circle(-20,100)
t.setheading(-125)
t.circle(-20,100)
t.setheading(-125)
t.circle(-20,100)
t.setheading(-135)
t.circle(-30,150)
t.end_fill()
#画云彩2
t.up()
t.goto(-350,163)
t.down()
t.begin_fill()
t.fillcolor("white")
t.setheading(-135)
t.circle(70,-80)
t.setheading(-135)
t.circle(30,-150)
t.setheading(-125)
t.circle(-20,100)
t.setheading(-125)
t.circle(-20,100)
t.setheading(-125)
t.circle(-20,100)
t.setheading(-135)
t.circle(-30,150)
t.end_fill()
#画云彩3
t.up()
t.goto(-100,250)
t.down()
t.begin_fill()
t.fillcolor("white")
t.setheading(-135)
t.circle(70,-80)
t.setheading(-135)
t.circle(30,-150)
t.setheading(-125)
t.circle(-20,100)
t.setheading(-125)
t.circle(-20,100)
t.setheading(-125)
t.circle(-20,100)
t.setheading(-135)
t.circle(-30,150)
t.end_fill()
#画草坪
t.fillcolor("green")
t.up()
t.goto(430,-10)
t.down()
t.setheading(180)
t.begin_fill()
for i in range(9):
    t.circle(100,30)
    t.circle(-100,30)
    t.setheading(170)
t.setheading(-90)
t.forward(300)  
t.left(90)  
t.forward(1000)
t.end_fill()  
#画房子
t.up()
t.goto(-10,-120)
t.down()
t.setheading(90)
t.begin_fill()
t.fillcolor(250,250,230)
t.forward(170)
t.right(90)
t.forward(300)
t.right(90)
t.forward(170)
t.right(90)
t.forward(300)
t.right(90)
t.end_fill()
#画房顶
t.up()
t.goto(-10,50)
t.down()
t.setheading(30)
t.begin_fill()
t.fillcolor(245,130,66)
t.forward(175)
t.setheading(-30)
t.forward(175)
t.end_fill()
#画窗户
t.up()
t.goto(230,0)
t.down()
t.setheading(180)
t.fillcolor("lightblue")
t.begin_fill()
for i in range(4):
    for g in range(4):
        t.forward(20)
        t.right(90)
    t.left(90)    
t.end_fill()
t.up()
t.goto(160,0)
t.down()
t.setheading(90)
t.begin_fill()
t.circle(20)
t.end_fill()
t.setheading(-180)
t.forward(40)
t.backward(20)
t.setheading(90)
t.forward(20)
t.backward(40)
t.end_fill()
t.up()
t.goto(50,0)
t.down()
t.begin_fill()
for i in range(4):
    for g in range(4):
        if g % 2 == 1:
            t.forward(20)
        else:
            t.forward(30)
        t.right(90)
    t.left(90)
t.end_fill()           

turtle.done()

代码收下!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值