Teach your kids to code : a parent-friendly guide to Python programming

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

"A guide to teaching basic programming skills for parents and teachers, with step-by-step explanations, visual examples, and exercises. Covers programming concepts including loops, lists, functions, and variables, and how to build games and applications"-- Provided by publisher. Includes index.

Author(s): Bryson Payne
Edition: 1
Publisher: No Starch Press
Year: 2015

Language: English
Pages: xxvi,308 pages :
City: San Francisco, CA

Advance Praise for Teach Your Kids to Code
About the Author
Brief Contents
Contents in Detail
Acknowledgments
Introduction: What Is Coding and Why Is It Good for Your Kids?
Why Should Kids Learn to Code?
Coding Is Fun
Coding Is a Valuable Job Skill
Where Can Kids Learn to Code?
How to Use This Book
Explore!
Do It Together!
Online Resources
Coding = Solving Problems
Chapter 1: Python Basics: Get to Know Your Environment
Getting Started with Python
1. Download Python
2. Install Python
3. Test Python with a Program
Writing Programs in Python
Running Programs in Python
What You Learned
Programming Challenges
#1: Mad Libs
#2: More Mad Libs!
Chapter 2: Turtle Graphics: Drawing with Python
Our First Turtle Program
How It Works
What Happens
Turtle on a Roll
Turtle Roundup
Adding a Touch of Color
A Four-Color Spiral
Changing Background Colors
One Variable to Rule Them All
What You Learned
Programming Challenges
#1: Changing the Number of Sides
#2: How Many Sides?
#3: Rubber-Band Ball
Chapter 3: Numbers and Variables: Python Does the Math
Variables: Where We Keep Our Stuff
Numbers and Math in Python
Python Numbers
Python Operators
Doing Math in the Python Shell
Syntax Errors: What Did You Say?
Variables in the Python Shell
Programming with Operators: A Pizza Calculator
Strings: The Real Characters in Python
Improving Our Color Spiral with Strings
Lists: Keeping It All Together
Python Does Your Homework
What You Learned
Programming Challenges
#1: Circular Spirals
#2: Custom Name Spirals
Chapter 4: Loops Are Fun (You Can Say That Again)
Building Your Own for Loops
Using a for Loop to Make a Rosette with Four Circles
Modifying Our for Loop to Make a Rosette with Six Circles
Improving Our Rosette Program with User Input
Game Loops and while Loops
The Family Spiral
Putting It All Together: Spiral Goes Viral
What You Learned
Programming Challenges
#1: Spiral Rosettes
#2: A Spiral of Family Spirals
Chapter 5: Conditions (What If?)
if Statements
Meet the Booleans
Comparison Operators
You’re Not Old Enough!
else Statements
Polygons or Rosettes
Even or Odd?
elif Statements
Complex Conditions: if, and, or, not
Secret Messages
Messin’ with Strings
The Value of Character(s)
Our Encoder/Decoder Program
What You Learned
Programming Challenges
#1: Colorful Rosettes and Spirals
#2: User-Defined Keys
Chapter 6: Random Fun and Games: Go Ahead, Take a Chance!
A Guessing Game
Colorful Random Spirals
Pick a Color, Any Color
Getting Coordinated
How Big Is Our Canvas?
Putting It All Together
Rock-Paper-Scissors
Pick a Card, Any Card
Stacking the Deck
Dealing Cards
Counting Cards
Keeping It Going
Putting It All Together
Roll the Dice: Creating a Yahtzee-Style Game
Setting Up the Game
Sorting the Dice
Testing the Dice
Putting It All Together
Kaleidoscope
What You Learned
Programming Challenges
#1: Random Sides and Thickness
#2: Realistic Mirrored Spirals
#3: War
Chapter 7: Functions: There’s a Name for That
Putting Things Together with Functions
Defining random_spiral()
Calling random_spiral()
Parameters: Feeding Your Function
Smileys at Random Locations
Putting It All Together
Return: It’s What You Give Back That Counts
Returning a Value from a Function
Using Return Values in a Program
A Touch of Interaction
Handling Events: TurtleDraw
Listening for Keyboard Events: ArrowDraw
Handling Events with Parameters: ClickSpiral
Taking It One Step Further: ClickandSmile
ClickKaleidoscope
The draw_kaleido() Function
The draw_spiral() Function
Putting It All Together
What You Learned
Programming Challenges
#1: Mirrored Smileys
#2: More Ping-Pong Calculations
#3: A Better Drawing Program
Chapter 8: Timers and Animation: What Would Disney Do?
Getting All GUI with Pygame
Drawing a Dot with Pygame
What’s New in Pygame
The Parts of a Game
Timing It Just Right: Move and Bounce
Moving a Smiley
Animating a Smiley with the Clock Class
Bouncing a Smiley Off a Wall
Bouncing a Smiley Off Four Walls
What You Learned
Programming Challenges
#1: A Color-Changing Dot
#2: 100 Random Dots
#3: Raining Dots
Chapter 9: User Interaction: Get into the Game
Adding Interaction: Click and Drag
Clicking for Dots
Dragging to Paint
Advanced Interaction: Smiley Explosion
Smiley Sprites
Setting Up Sprites
Updating Sprites
Bigger and Smaller Smileys
Putting It All Together
SmileyPop, Version 1.0
Detecting Collisions and Removing Sprites
Putting It All Together
What You Learned
Programming Challenges
#1: Randomly Colored Dots
#2: Painting in Colors
#3: Throwing Smileys
Chapter 10: Game Programming: Coding for Fun
Building a Game Skeleton: Smiley Pong, Version 1.0
Drawing a Board and Game Pieces
Keeping Score
Showing the Score
Putting It All Together
Adding Difficulty and Ending the Game: Smiley Pong, Version 2.0
Game Over
Play Again
Faster and Faster
Putting It All Together
Adding More Features: SmileyPop v2.0
Adding Sound with Pygame
Tracking and Displaying Player Progress
Putting It All Together
What You Learned
Programming Challenges
#1: Sound Effects
#2: Hits and Misses
#3: Clear the Bubbles
Appendix A: Python Setup for Windows, Mac, and Linux
Python for Windows
Download the Installer
Run the Installer
Try Out Python
Python for Mac
Download the Installer
Run the Installer
Try Out Python
Python 3 for Linux
Appendix B: Pygame Setup for Windows, Mac, and Linux
Pygame for Windows
Pygame for Mac
Python 2.7 and Pygame 1.9.2
Pygame for Linux
Pygame for Python 2 on Linux
Appendix C: Building Your Own Modules
Building the colorspiral Module
Using the colorspiral Module
Reusing the colorspiral Module
Additional Resources
Glossary
Index
Updates