Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python heart code

# Import turtle package
import turtle

# Creating a turtle object(pen)
pen = turtle.Turtle()

# Defining a method to draw curve
def curve():
	for i in range(200):

		#curve motion
		pen.right(1)
		pen.forward(1)

# method that draw the heart
def heart():
	# coloring
	pen.fillcolor('red')
# fill the color
	pen.begin_fill()
	#left line
	pen.left(140)
	pen.forward(113)
    #left curve
	curve()
	pen.left(120)
	# Draw the right curve
	curve()
	# Draw the right line
	pen.forward(112)
	# fill color again
	pen.end_fill()
# fill with text
def txt():
	pen.up()
	# positioning
	pen.setpos(-68, 95)
	# Move the turtle to the ground
	pen.down()
	# coloring u can also coose whatever color u wanna use
	pen.color('lightgreen')
    #write anything u want
	pen.write("Follow Paimon on Grepper", font=(
	"Verdana", 12, "bold"))


#run all the function
heart()
txt()
pen.ht()
Comment

PREVIOUS NEXT
Code Example
Python :: pandas dataframe from dict 
Python :: How to Add a Title to Seaborn Plots 
Python :: how to add static files in django 
Python :: remove non-alphabetic pandas python 
Python :: genspider scrapy 
Python :: install python3 centos 7.8 
Python :: image to pdf python 
Python :: extract first letter of column python 
Python :: py sleep function 
Python :: python read url 
Python :: string with comma to int python 
Python :: python radians to degrees 
Python :: how to change column type to string in pandas 
Python :: get local timezone python 
Python :: save matplotlib figure with base64 
Python :: How do I mock an uploaded file in django? 
Python :: debugging pytest in vscode 
Python :: python get copied text 
Python :: iterate through csv python 
Python :: python f-string format date 
Python :: linear search in python 
Python :: how to convert month to number in python 
Python :: dataframe rank groupby 
Python :: get attribute in selenium python 
Python :: center buttons tkinter 
Python :: string module in python 
Python :: df shift one column 
Python :: python datetime strptime hour minute second 
Python :: remove base from terminal anaconda 
Python :: list all files of a directory in Python 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =