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

Higher or Lower


Higher or Lower is a numbers guessing game. In this game, the computer chooses a random number, and the user tries to guess what number the computer has chosen. There are many different ways to build this game, and many versions of this game have been built by different people.

Our version of the game will have two levels:

  • An easy level

  • A hard level

The computer will first choose a random, secret number between 1 and 100. In the easy level, the user will get unlimited chances to guess the correct number. In the hard level, the user will only get three chances to guess the correct number, and then they will lose the game.

This game can be coded in different ways and still work well—this is one of the most awesome things about writing code. However, we will focus on writing code that uses a while loop for the easy version and a for loop for the hard version. This will let us practice our loops and build a game that has different levels of challenge.

To be successful in this chapter...