One of the most underrated #Python 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…
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
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
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
and the many balls one which deals with object-oriented programming:
_Bouncing Balls Using Object-Oriented Programming in Python
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
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
https://thepythoncodingbook.com/category/turtle/
I have loads and loads more which I’ll try to write up and publish in the coming months
#animations #python #turtle #coding #programming #LearnToCode #LearnPython
@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…
@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.