Book Image

Python Projects for Kids

By : Jessica Ingrassellino
Book Image

Python Projects for Kids

By: Jessica Ingrassellino

Overview of this book

Kids are always the most fast-paced and enthusiastic learners, and are naturally willing to build stuff that looks like magic at the end (when it works!). Programming can be one such magic. Being able to write a program that works helps them feel they've really achieved something. Kids today are very tech-savvy and cannot wait to enter the fast-paced digital world. Because Python is one of the most popular languages and has a syntax that is quite simple to understand, even kids are eager to use it as a stepping stone to learning programming languages. This book will cover projects that are simple and fun, and teach kids how to write Python code that works. The book will teach the basics of Python programming, installation, and so on and then will move on to projects. A total of three projects, with each and every step explained carefully, without any assumption of previous experience.
Table of Contents (18 chapters)
Python Projects for Kids
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Finding a remainder – modulo


Modulo can seem like a strange concept. In fact, unless you are a programmer, it is likely that you have never heard of modulo. Modulo is a mathematical function that allows us to do a division problem but only return the remainder. Why is this even useful? Why is it a good idea, and why should we care?

Usually, we want to know the entire answer to a division problem—the quotient and the remainder. There are times, though, when we will only want to know the remainder of the division problem. We will only care about what is leftover. Modulo is like a monster eating our dessert: we give the monster numbers to divide, and it just gives us leftovers.

While modulo is not especially useful in the world of school arithmetic, it can be very useful in moving objects in a game. So, it is good for us to build a modulo function and learn how modulo works.

To build a modulo function, you will need to get user input, just like all of the other functions you made. Then, you will...