Having fun learning Python and Turtle Module

Having fun learning Python and Turtle Module

Tags :

Category : code Python

Spirals with Turtle module

I’ve started to learn Python and during this process I’ve found the turtle module, that turned out to be a funny way to practice my recent acquired abilities to write flow control, function declaration, working with random library and so on.

I’ve enjoyed it so much that I’ve decide to create a little animation and share this with the world! I definitely indicate the Turtle module for Python students, specially for kids.

So, what exactly is the Turtle module? It’s a popular way for introducing programming to kids. You can control a robotic turtle starting at (0, 0) in the x-y plane. This way you can draw primitive and complex geometric forms to create animations and games. You can check out the Turtle documentation here.

My animation is a project for beginners in Python. It shows some experiments with the turtle module, like drawing some alphabet letters, changing a turtle to a GIF image and drawing a bunch of circles. It also uses the random library to change colors and circle positions randomly.

Check out also a YouTube video with the animation here!

Below you’ll find a piece of code showing the function created to draw circles with random location, radius and color. You can download the complete project in my GitHub repository here.

You can find links here to the turtle module documentation, the inspiration code to draw the alphabet with a turtle, the code example with Georgia’s spirals and a YouTube tutorial with the basic functions explained.

I hope you try out this module and have a lot of fun!! I’ll see you around!


Have you ever heard about HackerRank!?

HackerRank is a technology hiring platform that enables tech recruiters to evaluate the job candidate objectively. I wanted to brush up on my C programming language knowledge and start do learn C++ when I ran into HackerRank.

This platform is fantastic! You can solve several problems to achieve a high level of programming language proficiency in C, C++, Java, Python,
, etc. There are also tutorials like “30 Days of Code” and “10 Days of Statistics”. I particularly liked the “Problem Solving” section, it sharpens your ability to think outside the box. It is noteworthy that every proposed problem has a “Discussions” section where you can talk about the solution with other people.

They have a star reward system, that motivates you to keep programming, and a coin called “Hackos”, which also stimulates you to keep the attendance and helps you with problems solution. In addition, there is the “Leaderboard” organized by subjects. In this way, the platform works like a game and you don’t feel you are studying.

They have so many features that I haven’t had the chance to look into everything. For example, they also helps you to develop specialized skills like Artificial Intelligence, SQL and Databases and Regex.

You can check out my profile and the way I solve the problems at this link! If you want to point out where I can improve the code, please let me know!!

I hope you have a lot of fun with HackerRank!! Enjoy it!