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

Build your own function – name()


So, you have learned about variables and how they store information. You have also learned about how these variables can be used inside of a function. Finally, you have learned how to use special Python functions, such as input(), to help get information from users and store it in the computer. You are ready to build your own function using variables and input().

Set up your project file

The function that we will build now is called name(). The purpose of this function will be to ask the user their name, store (remember) the name, and then print out a friendly message to the user.

To start this function, do the following:

  1. Open a new file in your text editor.

  2. Go to Save and name the file name.py.

    Tip

    You need to use .py at the end of all of your code files so that the files run in the terminal/command prompt. Python only recognizes .py files.

  3. Save the file in the folder you made for all of your Python work.

Begin your project

Once you have set up a project file, the...