大家好,我是一个没有感情的程序员。
我今天要给大家画一些漂亮的形状,小编今天就给大家承受《青龙之力》
开个玩笑
“”“”“”“”“”“”“”“”“”“”“”“”“”“”“”“”“”“”“”“”“”“”“”“”
进入主题
“”“”“”“”“”“”“”“”“”“”“”“”“”“”“”“”“”“”“”“”“”“”“”“”
1.
import turtle as t
import math
t.pensize(3)
t.tracer(10)
t.hideturtle()
start_x = -200
for y in range(-150,150,5):
t.penup()
t.goto(start_x,y)
t.pendown()
for x in range(-200,200,1):
if ((y-50*(math.cos(0.05*x)) <= 80) and
(y-50*(math.cos(0.05*x)) >= 60)):
t.pencolor('yellow')
elif ((y-50*(math.cos(0.05*x)) <= 40) and
(y-50*(math.cos(0.05*x)) >= -20)):
t.pencolor('blue')
elif ((y-50*(math.cos(0.05*x)) <= -20) and
(y-50*(math.cos(0.05*x)) >= -80)):
t.pencolor('red')
elif ((y-50*(math.cos(0.05*x)) <= -60) and
(y-50*(math.cos(0.05)) <= -80)):
t.pencolor('green')
else:
t.pencolor('black')
t.setx(x)
t.update()
t.done()