代码如下:
import turtle as tu
import random as ra
#天空
tu.colormode(255)
tu.setup(515,315)
tu.bgcolor('midnight blue')
tu.speed(100)
#云层
tu.color('dark slate blue')
tu.pu()
tu.pensize(5)
tu.goto(ra.randint(-700,-258),128)
tu.pd()
tu.begin_fill()
tu.seth(-40)
for i in range(10):
tu.circle(40,80)
tu.circle(-40,80)
tu.goto(258,-158)
tu.goto(-258,-158)
tu.goto(-258,108)
tu.end_fill()
tu.pu()
tu.goto(ra.randint(-700,-258),108)
tu.color('MediumPurple3')
tu.pd()
tu.begin_fill()
tu.seth(-40)
for i in range(10):
tu.circle(40,80)
tu.circle(-40,80)
tu.goto(258,-158)
tu.goto(-258,-158)
tu.goto(-258,108)
tu.end_fill()
tu.pu()
tu.goto(ra.randint(-700,-258),