Magic 8 Ball – Using Python Blocks!

magic-eight-ballThe purpose of this post is to demonstrate how Python trinkets can be used to code with blocks.

Trinket blocks use the same approach as Scratch: A collection of blocks that the programmer can select to build their code in a more visual way.

The benefit of Trinket Blocks is that you can then view the Python code that it has generated.

A fantastic resource for those who are struggling with the syntax.

Also a great transition for those who have learned to program using Scratch and want to switch to text based programming e.g. using Python.

Look at this example that recreate the Magic 8 Ball program. Click on view code “>_” button to switch between the “Blocks code” and the Python code.

Did you like this challenge?

Click on a star to rate it!

Average rating 2.7 / 5. Vote count: 7

No votes so far! Be the first to rate this post.

As you found this challenge interesting...

Follow us on social media!

Tagged with: ,