Python教程

python 画爱心

本文主要是介绍python 画爱心,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

 

import turtle as t
t.shape ("turtle")
#爱心
t.pensize(6)
t.speed(1)
t.pencolor("red")
t.fillcolor("pink")
t.begin_fill()
t.left(90)
t.circle(50,180)
t.forward(30)
t.left(30)
t.forward(40)
t.goto(0,-120)
t.penup()
t.goto(0,0)
t.pendown()
t.seth(90)
t.circle(-50,180)
t.forward(30)
t.right(30)
t.forward(40)
t.goto(0,-120)
t.end_fill()
 

这篇关于python 画爱心的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!