The second edition of the best-selling Python for Kids–which brings you (and your parents) into the world of programming–has been completely updated to use the latest version of Python, along with tons of new projects!
Python is a powerful, expressive programming language that’s easy to learn and fun to use! But books about learning to program in Python can be dull and gray–and that’s no fun for anyone.
Python for Kids brings Python to life and brings kids (and their parents) into the wonderful world of programming. Author Jason R. Briggs guides readers through the basics, experimenting with unique (and often hilarious) example programs that feature ravenous monsters, secret agents, thieving ravens, and more. New terms are defined; code is colored, dissected, and explained; and quirky, full-color illustrations keep things fun and engaging throughout.
Chapters end with programming puzzles designed to stretch the brain and strengthen understanding. By the end of the book, young readers will have programmed two complete games: a clone of the famous Pong, and “Mr. Stick Man Races for the Exit”–a platform game with jumps, animation, and much more.
This second edition has been completely updated and revised to reflect the latest Python version and programming practices, with new puzzles to inspire readers to take their code farther than ever before. Why should serious adults have all the fun? Python for Kids is the ticket into the amazing world of computer programming.
Cover Page Title Page Copyright Page BRIEF CONTENTS CONTENTS IN DETAIL ACKNOWLEDGMENTS INTRODUCTION Why Python How to Learn to Code Who Should Read This Book What’s in This Book Python for Kids Website Have Fun! PART I LEARNING TO PROGRAM 1 NOT ALL SNAKES SLITHER A Few Words About Language Installing Python Once You’ve Installed Python Saving Your Python Programs What You Learned 2 CALCULATIONS AND VARIABLES Calculating with Python Python Operators The Order of Operations Variables Are Like Labels Using Variables What You Learned 3 STRINGS, LISTS, TUPLES, AND DICTIONARIES Strings Creating Strings Handling Problems with Strings Embedding Values in Strings Multiplying Strings Lists Are More Powerful than Strings Adding Items to a List Removing Items from a List List Arithmetic Tuples Python Dictionaries What You Learned Programming Puzzles 4 DRAWING WITH TURTLES Using Python’s Turtle Module Creating a Canvas Moving the Turtle What You Learned Programming Puzzles 5 ASKING QUESTIONS WITH IF AND ELSE If Statements A Block Is a Group of Programming Statements Conditions Help Us Compare Things If-Then-Else Statements if and elif Statements Combining Conditions Variables with No Value—None The Difference Between Strings and Numbers What You Learned Programming Puzzles 6 GOING LOOPY Using for Loops While We’re Talking About Looping What You Learned Programming Puzzles 7 RECYCLING YOUR CODE WITH FUNCTIONS AND MODULES Using Functions Parts of a Function Variables and Scope Using Modules The input function What You Learned Programming Puzzles 8 HOW TO USE CLASSES AND OBJECTS Breaking Things into Classes Children and Parents Adding Objects to Classes Defining Functions of Classes Adding Class Characteristics Why Use Classes and Objects? Objects and Classes in Pictures Other Useful Features of Objects and Classes Inherited Functions Functions Calling Other Functions Initializing an Object What You Learned Programming Puzzles 9 MORE TURTLE GRAPHICS Starting with the Basic Square Drawing Stars Drawing a Car Coloring Things In A Function to Draw a Filled Circle Creating Pure Black and White A Square-Drawing Function Drawing Filled Squares Drawing Filled Stars What You Learned Programming Puzzles 10 USING TKINTER FOR BETTER GRAPHICS Creating a Clickable Button Using Named Parameters Creating a Canvas for Drawing Drawing Lines Drawing Boxes Drawing a Lot of Rectangles Setting the Color Drawing Arcs Drawing Polygons Displaying Text Displaying Images Creating Basic Animation Making an Object React to Something More Ways to Use the Identifier What You Learned Programming Puzzles PART II BOUNCE! 11 BEGINNING YOUR FIRST GAME: BOUNCE! Whack the Bouncing Ball Creating the Game Canvas Creating the Ball Class Adding Some Action What You Learned Programming Puzzles 12 FINISHING YOUR FIRST GAME: BOUNCE! Adding the Paddle Making the Paddle Move Finding Out When the Ball Hits the Paddle Adding an Element of Chance What You Learned Programming Puzzles PART III MR. STICK MAN RACES FOR THE EXIT 13 CREATING GRAPHICS FOR THE MR. STICK MAN GAME Mr. Stick Man Game Plan Getting GIMP Creating the Game Elements Preparing a Transparent Image Drawing Mr. Stick Man Drawing the Platforms Drawing the Door Drawing the Background Transparency What You Learned 14 DEVELOPING THE MR. STICK MAN GAME Creating the Game Class Setting the Window Title and Creating the Canvas Finishing the __init__ Function Creating the mainloop Function Creating the Coords Class Checking for Collisions Sprites Colliding Horizontally Sprites Colliding Vertically Putting It All Together: Our Final Collision-Detection Code Creating the Sprite Class Adding the Platforms Adding a Platform Object Adding a Bunch of Platforms What You Learned Programming Puzzles 15 CREATING MR. STICK MAN Initializing the Stick Figure Loading the Stick Figure Images Setting Up Variables Binding to Keys Turning the Stick Figure Left and Right Making the Stick Figure Jump What We Have So Far What You Learned 16 COMPLETING THE MR. STICK MAN GAME Animating the Stick Figure Creating the Animate Function Getting the Stick Figure’s Position Making the Stick Figure Move Testing Our Stick Figure Sprite The Exit! Creating the DoorSprite Class Detecting the Door Adding the Door Object The Final Game What You Learned Programming Puzzles AFTERWORD: WHERE TO GO FROM HERE Installing Python pip on Windows Installing Python pip on Ubuntu Installing Python pip on Raspberry Pi Installing Python pip on macOS Trying out PyGame Other Games and Graphics Programming Other Programming Languages Final Words A PYTHON KEYWORDS B PYTHON’S BUILT-IN FUNCTIONS C TROUBLESHOOTING INDEX
How to download source code?
1. Go to:
2. Search the book title:
Python for Kids, 2nd Edition: A Playful Introduction to Programming, sometime you may not get the results, please search the main title
3. Click the book title in the search results
3. Download the Source Code.
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.