You are previewing Adventures in Python.
O'Reilly logo
Adventures in Python

Book Description

The complete beginner's guide to Python, for young people who want to start today

Adventures in Python is designed for 11-to 15-year olds who want to teach themselves Python programming, but don't know where to start. Even if you have no programming experience at all, this easy to follow format and clear, simple instruction will get you up and running quickly. The book walks you through nine projects that teach you the fundamentals of programming in general, and Python in particular, gradually building your skills until you have the confidence and ability to tackle your own projects. Video clips accompany each chapter to provide even more detailed explanation of important concepts, so you feel supported every step of the way.

Python is one of the top programming languages worldwide, with an install base in the millions. It's a favourite language at Google, YouTube, the BBC, and Spotify, and is the primary programming language for the Raspberry Pi. As an open-source language, Python is freely downloadable, with extensive libraries readily available, making it an ideal entry into programming for the beginner. Adventures in Python helps you get started, giving you the foundation you need to follow your curiosity.

  • Start learning Python at its most basic level

  • Learn where to acquire Python and how to set it up

  • Understand Python syntax and interpretation for module programming

  • Develop the skills that apply to any programming language

  • Python programming skills are invaluable, and developing proficiency gives you a head start in learning other languages like C++, Objective-C, and Java. When learning feels like fun, you won't ever want to stop - so get started today with Adventures in Python.

    Table of Contents

    1. Cover
    2. Title Page
    3. About the Author
    4. Introduction
      1. What Is Programming?
      2. What Is Python and What Can You Do With It?
      3. Who Should Read This Book?
      4. What You Will Learn
      5. What You Will Need for the Projects
      6. How This Book Is Organised
      7. Setting Up Python
      8. Creating Your First Program
      9. The Companion Website
      10. Conventions
      11. Reaching Out
    5. Adventure 1: Diving into Python
      1. What Is Programming?
      2. Opening IDLE
      3. Returning to Your First Python Program
      4. It Isn’t Working—Grrr!
      5. Using a File Editor
      6. Asking Questions with Variables
      7. Making the Program Make Decisions: Conditionals
      8. Repeating Code with Loops
      9. Praise Generator
      10. A Bigger Adventure: Spaceship Control Console
    6. Adventure 2: Drawing with Turtle Graphics
      1. Getting Started with Turtle
      2. Using Variables to Change Angles and Lengths
      3. Using Addition to Draw a Spiral
      4. Saving Some Space with Loops
      5. A Shape with 360 Sides: Drawing a Circle
      6. Creating Functions to Reuse Your Code
      7. Shape Presets
      8. Adding Randomly Generated Pictures
    7. Adventure 3: Windows, Buttons, and Other GUI Stuff
      1. Creating Buttons
      2. Creating Text Boxes
      3. Building a Random Sentence Generator
      4. Programming a Guessing Game
    8. Adventure 4: More GUI Elements with Tkinter
      1. Creating Sliders
      2. How Colours Work on Computers and as Hexadecimal Values
      3. Changing the Canvas Colour
      4. Making the Colour Picker
      5. Adding a Text Box
      6. Creating a Click Speed Game
    9. Adventure 5: Drawing Shapes with PyGame
      1. Installing PyGame
      2. My First PyGame
      3. Creating Rectangles
      4. Creating Ellipses
      5. Saving Your Images
    10. Adventure 6: Adding Keyboard Input with PyGame
      1. Using Keyboard Input
      2. Other Keys You Can Use
      3. Creating the Game
    11. Adventure 7: Creative Ways to Use a Mouse with PyGame
      1. Getting the Mouse Position
      2. Making a Mesh
      3. Creating Mouse Trails
    12. Adventure 8: Using Images with PyGame
      1. Loading an Image
      2. Adding a Moustache to a Photograph
      3. Making Sprites
    13. Adventure 9: Using Sounds and Music with PyGame
      1. Playing Sounds
      2. Using Music with Python
      3. Adding Sounds and Music to a Game
    14. Adventure 10: Your Really Big Adventure
      1. Writing the Program for the Game
      2. Debugging the Game
      3. Summary
    15. Appendix A: Installing and Downloading the Proper Files
      1. Installing PyGame
      2. Downloading the Files for Adventures 8, 9 and 10
    16. Glossary
    17. End User License Agreement