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

PDF
Datatypes in python
eShikshak
 
PDF
Python Functions Tutorial | Working With Functions In Python | Python Trainin...
Edureka!
 
ODP
Python Modules
Nitin Reddy Katkam
 
PPTX
Python Basics
Pooja B S
 
PDF
Introduction to python programming
Srinivas Narasegouda
 
PDF
Strings in python
Prabhakaran V M
 
PDF
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Edureka!
 
PPTX
Beginning Python Programming
St. Petersburg College
 
Datatypes in python
eShikshak
 
Python Functions Tutorial | Working With Functions In Python | Python Trainin...
Edureka!
 
Python Modules
Nitin Reddy Katkam
 
Python Basics
Pooja B S
 
Introduction to python programming
Srinivas Narasegouda
 
Strings in python
Prabhakaran V M
 
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Edureka!
 
Beginning Python Programming
St. Petersburg College
 

What's hot (20)

PPTX
Python basics
RANAALIMAJEEDRAJPUT
 
PPT
Introduction to Python
amiable_indian
 
PPT
Python Programming Language
Dr.YNM
 
PPTX
Fundamentals of Python Programming
Kamal Acharya
 
PPTX
Python Exception Handling
Megha V
 
PDF
Python - the basics
University of Technology
 
PPTX
Introduction to the basics of Python programming (part 1)
Pedro Rodrigues
 
PPTX
Packages In Python Tutorial
Simplilearn
 
PPTX
Python | What is Python | History of Python | Python Tutorial
QA TrainingHub
 
PPTX
Need of object oriented programming
Amar Jukuntla
 
PPTX
File handling
priya_trehan
 
PDF
Python final ppt
Ripal Ranpara
 
PPTX
Python basics
Hoang Nguyen
 
PDF
Let’s Learn Python An introduction to Python
Jaganadh Gopinadhan
 
PPTX
Python strings presentation
VedaGayathri1
 
PPTX
Python 101: Python for Absolute Beginners (PyTexas 2014)
Paige Bailey
 
PDF
Python GUI
LusciousLarryDas
 
PDF
Python programming
Prof. Dr. K. Adisesha
 
PDF
Python - gui programming (tkinter)
Learnbay Datascience
 
Python basics
RANAALIMAJEEDRAJPUT
 
Introduction to Python
amiable_indian
 
Python Programming Language
Dr.YNM
 
Fundamentals of Python Programming
Kamal Acharya
 
Python Exception Handling
Megha V
 
Python - the basics
University of Technology
 
Introduction to the basics of Python programming (part 1)
Pedro Rodrigues
 
Packages In Python Tutorial
Simplilearn
 
Python | What is Python | History of Python | Python Tutorial
QA TrainingHub
 
Need of object oriented programming
Amar Jukuntla
 
File handling
priya_trehan
 
Python final ppt
Ripal Ranpara
 
Python basics
Hoang Nguyen
 
Let’s Learn Python An introduction to Python
Jaganadh Gopinadhan
 
Python strings presentation
VedaGayathri1
 
Python 101: Python for Absolute Beginners (PyTexas 2014)
Paige Bailey
 
Python GUI
LusciousLarryDas
 
Python programming
Prof. Dr. K. Adisesha
 
Python - gui programming (tkinter)
Learnbay Datascience
 
Ad

More from grahamwell (20)

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