Python-turtle Graphics

Source: Internet
Author: User

1 ImportTurtle#allows us to use the Turtles library2WN = Turtle. Screen ()#creates a graphics window3Wn.bgcolor ("LightGreen")#set the window background color4 5Alex = Turtle. Turtle ()#Create a turtle named Alex6Alex.pensize (3)#Set the width of her pen7Alex.color ("Pink")#Make Alex pink color is attribute8Alex.forward (150)#Tell Alex to move forward by units9Alex.left (90)#turn by degrees, right was clockwise, left is counter clockwiseTenAlex.forward (75)#Complete the second side of a rectangle OneAlex.left (90)             AAlex.forward (150) -Alex.left (90) -Alex.forward (75) the  -Tess =Turtle. Turtle () -Tess.color ("Hotpink") -Tess.pensize (5) +  -Tess.forward (150) +Tess.left (120) ATess.forward (150) atTess.left (120) -Tess.forward (150) -  -David =Turtle. Turtle () -David.color ("Blue") -David.pensize (5) in  -  forIinch["Yellow","Red","Purple","Blue"]: to David.color (i) +David.forward (150) -David.left (90) the  *Wn.exitonclick ()#wait for a user click on the canvas

Python-turtle Graphics

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.