Introduction to Python Turtle Graphics for GCSE Students

undefined
Programming for GCSE
Topic 8.3: Python Turtle
Graphics
T
eaching
  
L
ondon 
 
C
omputing
William Marsh
School of Electronic Engineering and Computer Science
Queen Mary University of London
Aims
Outline the idea of turtle graphics
Evaluate turtle graphics for learning
programming
undefined
P
RINCIPLES
 
OF
 T
URTLE
G
RAPHICS
 
from turtle import *
pencolor('red')
pensize(5)
fillcolor('yellow')
begin_fill()
forward(80), left(120)
forward(80), left(120)
forward(80), left(120)
penup()
forward(150)
circle(80)
end_fill()
done()
from turtle import *
pencolor('red')
pensize(5)
fillcolor('yellow')
begin_fill()
forward(80), left(120)
forward(80), left(120)
forward(80), left(120)
penup()
forward(150)
circle(80)
end_fill()
done()
Pen size and
colour
Turtle
movement
Fill – start
and end
Stop drawing
Documentation
See chapter 23 of Python library
Functions: simpler, as shown
Object-orient methods: more flexible
Simplified extract in the practical sheet
Omits synonyms
More complex features
undefined
H
OW
 U
SEFUL
 I
S
 T
URTLE
G
RAPHICS
?
Could use turtle graphics as an introductions
Advantages
Visual
Picture and simple animation
Text I/O included
Not really for graphical UI or games
Problem solving and creativity
Functions
Obvious need for decomposition into functions
Limitations
Less focus on variables: very important
concept
Many problems can be solved (badly) without
control structures (if and loops)
Not a great match to GCSE syllabus
Example Challenge Problems
Handle shapes as data
Save in file
E.g. ['square', 100, 30, 40] – size, x, y
Do transformations on shapes
Rotate
Reflect
Display data
E.g. bar or line graph
Summary
Turtle graphics is simple and visual
Consider it as an alternative route for
transition between visual (e.g. Scratch) and
textual programming
Slide Note
Embed
Share

Explore the concept of turtle graphics in Python programming through visual representation and simple animations. Learn about the principles of turtle graphics, advantages, limitations, and how to use it effectively for learning programming. Discover the potential challenges and solutions offered by working with shapes as data in Python Turtle Graphics.


Uploaded on Sep 28, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. TeachingLondon Computing Programming for GCSE Topic 8.3: Python Turtle Graphics William Marsh School of Electronic Engineering and Computer Science Queen Mary University of London

  2. Aims Outline the idea of turtle graphics Evaluate turtle graphics for learning programming

  3. PRINCIPLESOF TURTLE GRAPHICS

  4. from turtle import * pencolor('red') pensize(5) fillcolor('yellow') begin_fill() forward(80), left(120) forward(80), left(120) forward(80), left(120) penup() forward(150) circle(80) end_fill() done()

  5. from turtle import * pencolor('red') pensize(5) fillcolor('yellow') Pen size and colour Turtle movement begin_fill() forward(80), left(120) forward(80), left(120) forward(80), left(120) Fill start and end penup() forward(150) circle(80) end_fill() Stop drawing done()

  6. Documentation See chapter 23 of Python library Functions: simpler, as shown Object-orient methods: more flexible Simplified extract in the practical sheet Omits synonyms More complex features

  7. HOW USEFUL IS TURTLE GRAPHICS? Could use turtle graphics as an introductions

  8. Advantages Visual Picture and simple animation Text I/O included Not really for graphical UI or games Problem solving and creativity Functions Obvious need for decomposition into functions

  9. Limitations Less focus on variables: very important concept Many problems can be solved (badly) without control structures (if and loops) Not a great match to GCSE syllabus

  10. Example Challenge Problems Handle shapes as data Save in file E.g. ['square', 100, 30, 40] size, x, y Do transformations on shapes Rotate Reflect Display data E.g. bar or line graph

  11. Summary Turtle graphics is simple and visual Consider it as an alternative route for transition between visual (e.g. Scratch) and textual programming

More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#