# coding:utf-8 2 import turtle as t 3 import random 4 # 画心 5 def xin () : 6 def curvemove () : 7 for i in range(200 ): 8 t.right(1 ) 9 t.forward(0.5 ) 10 t.color('red' ,'red' ) 11 t.begin_fill() 12 t.left(140 ) 13 t.forward(60 ) 14 curvemove() 15 t.left(120 ) 16 curvemove() 17 t.forward(60 ) 18 t.end_fill() 19 # 心里面的十字 20 def shizi () : 21 t.pu() 22 t.goto(170 ,285 ) 23 t.seth(0 ) 24 t.pd() 25 t.color("black" ,"black" ) 26 t.circle(1.5 ) 27 t.pensize(2 ) 28 t.fd(55 ) 29 t.pensize(4 ) 30 t.circle(1.5 ) 31 t.pu() 32 t.seth(-90 ) 33 t.goto(198 ,295 ) 34 t.seth(-90 ) 35 t.pensize(2 ) 36 t.pd() 37 t.fd(65 ) 38 t.circle(1.5 ) 39 t.circle(160 ,40 ) 40 t.circle(-130 ,27 ) 41 t.circle(-60 ,40 ) 42 t.circle(80 ,60 ) 43 # 夹子 44 def jiazi2 () : 45 def jiazi (angle) : 46 t.pd() 47 t.pensize(1 ) 48 t.color("black" ,"brown" ) 49 t.begin_fill() 50 t.seth(angle) 51 t.fd(20 ) 52 t.seth(angle