Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
7 views

Programs Python

The document uses the turtle library in Python to draw a face with eyes, a nose and a smile by having the turtle pen move and turn specified amounts of degrees and distances multiple times in for loops.

Uploaded by

ejaman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Programs Python

The document uses the turtle library in Python to draw a face with eyes, a nose and a smile by having the turtle pen move and turn specified amounts of degrees and distances multiple times in for loops.

Uploaded by

ejaman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

# import turtle library

import turtle

my_wn = turtle.Screen()

turtle.speed(2)
for i in range(30):

turtle.circle(5*i)

turtle.circle(-5*i)

turtle.left(i)

turtle.exitonclick()

------------------------

import turtle

turtle.pensize(4)

turtle.speed(3)

#left eye

turtle.penup()

for i in range(5):

turtle.pendown()

turtle.forward(25)

turtle.right(90)

#right eye

turtle.left(90)

turtle.penup()

turtle.forward(50)

for i in range(4):
turtle.pendown()

turtle.forward(25)

turtle.right(90)

#nose

turtle.right(90)

turtle.penup()

turtle.forward(35)

turtle.pendown()

for i in range(2):

turtle.forward(25)

turtle.right(90)

turtle.forward(50)

turtle.right(90)

#smile

turtle.forward(25)

turtle.left(90)

turtle.penup()

turtle.forward(25)

turtle.pendown()

turtle.right(135)
turtle.forward(30)

turtle.right(45)

turtle.forward(60)

turtle.right(45)

turtle.forward(30)

----------------------

You might also like