SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
Turtle graphics
Using a Turtle
Imagine a Turtle …
 Crawling over a huge
sheet of paper
 With a pen tied to its
tail.




You can command it.
The basics

Tells Python to use the
Turtle module

Sets up a Turtle and makes
it a Turtle Shape

Moves forward 100 pixels
Turns right by 90 degrees

Closes the graphic window
when you quit
Challenges


Draw a square:
 By repeating the same commands four times


 Using ‘For I in range(4):’ 



Draw a hexagon
Allow the user to say how many sides
the polygon should have
 Remember, use

‘myVariable = int(raw_input)’ to get a
number from the user


Get the turtle to draw your initials

More Related Content

PPTX
File handling in Python
PPTX
File Handling Python
PDF
Python list
ODP
OOP java
PPT
standard template library(STL) in C++
PPTX
Abstract Class & Abstract Method in Core Java
PPTX
Chapter 05 classes and objects
PPTX
Python pandas Library
File handling in Python
File Handling Python
Python list
OOP java
standard template library(STL) in C++
Abstract Class & Abstract Method in Core Java
Chapter 05 classes and objects
Python pandas Library

What's hot (20)

PPTX
User defined functions in C
PPTX
Python Data Structures and Algorithms.pptx
PPTX
Python Functions
PPT
PPTX
CLASS OBJECT AND INHERITANCE IN PYTHON
PPTX
Type casting in java
PPTX
Python dictionary
PPT
Python List.ppt
PPT
File handling in c
PPTX
Python dictionary
PPTX
Inline function
PPT
Arrays in c
PPTX
List in Python
PPTX
File Management in C
PPT
CSS for Beginners
PPTX
Presentation on Function in C Programming
PPTX
Standard Template Library
PPTX
Constructor ppt
PPTX
Operator overloading
User defined functions in C
Python Data Structures and Algorithms.pptx
Python Functions
CLASS OBJECT AND INHERITANCE IN PYTHON
Type casting in java
Python dictionary
Python List.ppt
File handling in c
Python dictionary
Inline function
Arrays in c
List in Python
File Management in C
CSS for Beginners
Presentation on Function in C Programming
Standard Template Library
Constructor ppt
Operator overloading
Ad

More from grahamwell (20)

PPTX
Pseudocode
PPT
Excel =if function
PPT
Excel Min max-average
PPTX
What is binary and why do we use it?
PPTX
Introduction to touch develop
PPTX
Introduction to touch develop
PPTX
The software story
PPTX
Database field types
PPTX
Databases 101
PPTX
Kodu controls
PPT
Pascal names and types
PPT
Python part two names and types
PPTX
Abstraction - Year 9
PPTX
Thinking about your project
PPTX
The rail fence
PPT
Lesson 1
PPT
Rsa encryption
PPT
Server side scripts
PPTX
Revision topic 1 sensors and control
PPTX
Mtslesson
Pseudocode
Excel =if function
Excel Min max-average
What is binary and why do we use it?
Introduction to touch develop
Introduction to touch develop
The software story
Database field types
Databases 101
Kodu controls
Pascal names and types
Python part two names and types
Abstraction - Year 9
Thinking about your project
The rail fence
Lesson 1
Rsa encryption
Server side scripts
Revision topic 1 sensors and control
Mtslesson
Ad

Turtle graphics

  • 2. Using a Turtle Imagine a Turtle …  Crawling over a huge sheet of paper  With a pen tied to its tail.   You can command it.
  • 3. The basics Tells Python to use the Turtle module Sets up a Turtle and makes it a Turtle Shape Moves forward 100 pixels Turns right by 90 degrees Closes the graphic window when you quit
  • 4. Challenges  Draw a square:  By repeating the same commands four times   Using ‘For I in range(4):’    Draw a hexagon Allow the user to say how many sides the polygon should have  Remember, use ‘myVariable = int(raw_input)’ to get a number from the user  Get the turtle to draw your initials