PROGRAMMING
FOR
YOUNG CODERS
A Hands-On, Project-Based Introduction to
Coding for Beginners, Kids, and Teens
Anand Pandey
©
SC RIB INK
--------- PUBLISHING----------
,Python Programming for Young Coders: A Hands-On, Project-Based Introduction to Coding for
Beginners, Kids, and Teens, 1st Edition.
Copyright © 2025 by Anand Pandey
All rights reserved. No portion of this book may be reproduced in any form without written permission
from the publisher or author, except as permitted by U.S. copyright law.
No part of this book may be reproduced, distributed, or transmitted in any form or by any means, including
photocopying, recording, or other electronic or mechanical methods, without the prior written permission
of the publisher or author, except in the case of brief quotations embodied in critical reviews and certain
other noncommercial uses permitted by U.S. copyright law. For permission requests, write to the publisher
at the address below.
Publisher:
Scrib Ink Publishing.
Plymouth Meeting, PA, USA
www.scrib.ink
ISBN: 978-0-9997408-6-6
Disclaimer: While the author and publisher have made every effort to ensure the accuracy and completeness of
information contained in this book, we assume no responsibility for errors, omissions, or contrary interpretations of the
subject matter herein. This book is for informational purposes only and is provided on an "as-is" basis. The author and
publisher shall not be liable for any losses or damages arising from the use of this book.
Some references used in this book are derived from The Python Language Reference by Guido van Rossum and others,
published by the Python Software Foundation. For detailed information, please visit the official Python documentation:
http://docs.python.org/py3k/reference/index.html.
This book references and discusses the Mu Editor, an open-source Python IDE created by Nicholas H.Tollervey and
contributors. Mu Editor is licensed under the GNU General Public License (GPL) v3.0. For more details, visit
https://github.com/mu-editor/mu.
This book references and discusses Trinket, an online Python IDE and platform for writing, running, and sharing Python
code, created by the team at Trinket. Trinket is licensed under its own terms and conditions. For more details, visit
https://trinket.io.
Some of the icons used in this book were designed by Freepik (https://www.freepik.com/) and are used in compliance
with their licensing terms.
, Table of Contents
ABOUT THE AUTHOR..................................................................................................................................... 9
INTRODUCTION .......................................................................................................................................... 13
GETTING READY FOR PYTHON PROGRAMMING .......................................................................................... 15
Programming Language .................................................................................................................................. 15
Program VS Code............................................................................................................................................. 16
Why Learn Coding? 18
What IS Python? .............................................................................................................................................. 19
What Can You DO with Python? 21
Why IS IT Named Python? 22
How Long Does IT Take to Learn Python? 22
Writing A Python Program 23
Getting Started with Mu Editor ................................................................................................................. 23
Running A Python Program 27
What Is a Script? ........................................................................................................................................ 27
Code Formatting in the Book 32
Review Questions ............................................................................................................................................ 33
DRAWING WITH PYTHON ............................................................................................................................ 35
Degrees ........................................................................................................................................................... 38
VARIABLES .................................................................................................................................................. 45
Variable Assignment Statement ....................................................................................................................... 48
Variable Naming Rules ..................................................................................................................................... 49
Review Questions ............................................................................................................................................ 51
FUNCTION BASICS ....................................................................................................................................... 53
Python's Built-in Functions 55
Printing Python's Output - The print() Function.................................................................................. 55
Receive User Feedback - The input() Function..................................................................................... 58
Review Questions ............................................................................................................................................ 60
DATA TYPES ................................................................................................................................................ 63
Integers ........................................................................................................................................................... 64
Floating Point Numbers .................................................................................................................................. 65
, Strings ............................................................................................................................................................ 66
Boolean ........................................................................................................................................................... 67
Other Data Types ............................................................................................................................................. 69
Data Type Conversion ...................................................................................................................................... 69
Converting Strings to Integers ................................................................................................................... 69
Converting Strings to Floats ....................................................................................................................... 70
Converting Numbers to Strings .................................................................................................................. 70
Review Questions ............................................................................................................................................. 72
CODE EXECUTION FLOW .............................................................................................................................. 75
OPERATORS................................................................................................................................................. 83
Types of Operators .......................................................................................................................................... 84
Arithmetic Operators ...................................................................................................................................... 84
Comparison Operators .................................................................................................................................... 85
Assignment Operators ..................................................................................................................................... 87
Chaining Assignments ................................................................................................................................ 88
Logical Operators ........................................................................................................................................... 88
Logical operator precedence ...................................................................................................................... 90
Review Questions ............................................................................................................................................. 92
NUMBERS.................................................................................................................................................... 95
Mathematical Expressions ............................................................................................................................... 96
Numbers - Integers and Floats ......................................................................................................................... 97
Converting Numbers ........................................................................................................................................ 97
int() ............................................................................................................................................................ 98
float() ......................................................................................................................................................... 98
Basic Arithmetic Operators .............................................................................................................................. 99
New Operators .............................................................................................................................................. 102
Floor and Ceiling ...................................................................................................................................... 102
Floor Division ........................................................................................................................................... 103
Exponentiation ......................................................................................................................................... 104
Modulo ......................................................................................................................................................... 105
Random Numbers........................................................................................................................................... 106
Review Questions ........................................................................................................................................... 109
STRINGS .................................................................................................................................................... 111
String Creation ............................................................................................................................................. 112