One of the most underrated modules?

**`turtle`**

We know it's used for teaching & not in the "real-world"

But it's usually used only for basic drawings & simple animations for kids–a very limited scope

_We can teach more advanced topics, too…_

Here are some examples…

---

# 1. Data structures: lists, tuples, dictionaries, and sets

Here's an animation that uses all four of these structures:

_[Practise Using Lists, Tuples, Dictionaries, and Sets in Python With the Chaotic Balls Animation](thepythoncodingbook.com/2021/1)_

---

# 2. Named Tuples

And a bit further down the line, here's an example of a `turtle` animation of a sunrise that introduces Named Tuples:

_[Sunrise: A Python Turtle Animation using Named Tuples](thepythoncodingbook.com/2022/0)_

---

# 3. Demonstrating real-world processes

Maybe we want to use it model real-world processes in a quick-and-simple way.

Here is a demonstration of "simulating" bouncing balls

There's the single ball version:
_[The Real World in Python: Coding A Bouncing Ball](thepythoncodingbook.com/2021/0)_

and the many balls one which deals with **object-oriented programming**:
_[Bouncing Balls Using Object-Oriented Programming in Python](thepythoncodingbook.com/2021/0)

And, one of my favourites, a simulations of planets orbiting one or more stars. The `turtle` version is in 2D:
_[Simulating Orbiting Planets in a Solar System Using Python](thepythoncodingbook.com/2021/0)_

_There's also a 3D version which uses Matplotlib instead of turtle, but that's off-topic here so I'll post another time_

---

Here are some more ideas from projects I've written up recently

thepythoncodingbook.com/catego

I have loads and loads more which I'll try to write up and publish in the coming months

@s_gruppetta I think it should allow Python to tick all the boxes that Papert's Logo language did for permitting children to primarily build functions that draw objects ... such as the examples of drawing a triangle and a rectangle and then combining them to draw a little house.

I think most of the material in the Mindstorms book could be adapted to some rudimentary Python constructs.

@jimlawless yes, but I think the classic examples of drawing triangles and squares and so on are _very_ limited in scope and can get boring and childish very quickly.

The module can be used for a lot more than that…

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.