Captain Code: Unleash Your Coding Superpower with Python © 2022

Captain Code, published by Pearson, introduces computer coding to students aged ten to seventeen through a fun, light, and unintimidating tone. Focusing on Python, the program teaches all the major concepts around code students will encounter if they learn other programming languages.

  • Student-friendly design
  • Clear and easy-to-understand language
  • Bonus content to help with learning Python
  • Designed for Grades 7-12

Introductory Computer Programming Curriculum

Teach students to become coders using the Python language in a technical education program aimed at middle and high schoolers.


Applicable Across Languages

Captain Code teaches concepts such as variables, loops, conditional processing, and classes, which students can use to learn other computer languages.


Student-Friendly Design

The text makes ample use of illustrations and graphics, including cartoon chapter openers, and a pleasing layout to create a welcoming tone around what can be seen as formidable subject matter.


Clear Writing

Captain Code’s authors remain deeply aware of the curriculum’s audience, and they have kept their descriptions of coding terms and processes easy to understand so everyone can follow along.

Python Language Coding Teaching Solutions

  • Sophisticated Coding Projects
  • Additional Resources for Deeper Understanding
  • Visual Learning for the Modern Student

Sophisticated Coding Projects

  • Efficient Design
    In the first section, each chapter is a complete lesson with a project.
  • Long-term Projects
    Sections two and three span projects over multiple lessons to help students build upon what they have already learned.

Additional Resources for Deeper Understanding

  • Bonus Content
    QR codes within the textbook link out to bonus video content, downloads, and challenge solutions that help explain difficult concepts.

Visual Learning for the Modern Student

  • Visual Clarification
    Graphics and illustrations accompany each new concept to help make them easier to understand.
  • Clear Syntax
    All code listings are in full-color to clearly define the syntax for students.

Frequently Asked Questions about Captain Code

  • What subjects are covered in the table of contents?



    Chapter 1 Getting Started

    Understanding Computer Programming

    • What is a computer?
    • How do we talk to computers?
    • What is Python?


    Setting Things Up

    • Installing Python
    • Installing and Configuring VisualStudio Code
    • Creating a Work Folder


    Writing Your First Python Program

    • Selecting Your Work Folder
    • It’s Coding Time!


    Chapter 2 Mad Libs

    Understanding Functions

    Using Variables

    • Creating a Variable
    • Using a Variable
    • Some Important Variable Rules
    • Variables, More Variables, and Even More Variables
    • Getting User Input


    Playing Mad Libs

    • Write Your Story
    • Add Variables
    • Get User Input


    Chapter 3 Roll the Dice

    Using Libraries

    • The random Library
    • Generating Random Numbers
    • Choosing a Random Item


    “3” Is Not 3

    Commenting Your Code

    One Die, Two Dice


    Chapter 4 Calculate the Day

    Working with Dates

    • The datetime Library
    • Using the datetime Class


    Making Decisions

    • The if Statement
    • What else?
    • if Revisited
    • Testing for Other Options
    • Using in


    Beating the Mathematician

    • Handling Numeric Inputs
    • Putting It All Together
    • An Alternate Solution


    Chapter 5 Rock Paper Scissors

    More Strings

    Game Time

    • Handling User Input
    • The Game Code
    • One Last Tweak


    Chapter 6 Secret Codes


    • Creating Lists
    • Accessing List Items
    • Changing List Items
    • Adding and Removing Items
    • Finding Items
    • Sorting



    • Looping Through Items
    • Looping Through Numbers
    • Nested Loops


    Cracking the Code

    • Encrypting Characters
    • Modulus Math
    • Encryption Code
    • Decryption Code


    Chapter 7 Guess the Number

    Conditional Loops

    Game Time

    • The Basic Game
    • Putting It All Together


    Chapter 8 Becoming a Coder

    How Coders Code

    • Have a Plan
    • Think Small


    Game Components

    • Restricting User Input
    • Storing User Guesses
    • Displaying Lists
    • Masking Characters


    Chapter 9 Hangman

    Game Time

    So How Does It Work?


    Chapter 10 Keep Going

    Birthday Countdown

    • Program Requirements
    • Program Flow
    • Some Tips


    Tip Calculator

    • program requirements
    • program flow
    • some tips (pun intended)


    • Program Requirements
    • Program Flow
    • Some Tips



    Chapter 11 Getting Func-ky

    Functions Revisited

    • Creating a Function
    • Passing Arguments
    • Returning Values


    Chapter 12 Exploring

    Game Concept

    • Game Structure
    • Prompting for Options
    • Processing Options
    • Create a Work Folder


    Game Time

    Test It


    Chapter 13 Cleanup Time

    Optimizing Your Code


    • String Externalization
    • Creating the Strings File
    • Using Externalized Strings


    Chapter 14 Reduce, Reuse, Recycle, Refactor

    Understanding Refactoring

    • Identifying Refactoring Opportunities


    Creating a User Choice Component

    • Designing a Reusable Component
    • Creating the User Options Function
    • Updating Your Code


    Chapter 15 Carrying (and Using) Stuff

    Planning the Inventory System

    • Creating a Dictionary
    • Working with Dictionaries
    • Lists of Dictionaries


    The Inventory System

    • Creating an Inventory
    • Plugging In the Inventory System
    • Using the Inventory System
    • Displaying the Inventory



    Chapter 16 Keeping It Classy

    The Player System


    Creating a Player Class

    • Creating the Class
    • Defining Properties
    • Creating Methods
    • Initializing the Class

    Using Our New Class


    Chapter 17 Color Your World

    Installing Third-Party Libraries


    Using Colorama

    • Importing and Initializing the Library
    • Coloring Your Output


    Chapter 18 Keep Going

    • Health and Lives
    • Shopping for Items
    • Random Events
    • Battling Enemies
    • Saving and Restoring



    Chapter 19 Crazy Driver

    Introducing Pygame


    Prepping the Game

    • Game Concept
    • Installing Pygame
    • Creating Work Folders
    • Obtaining Images


    Getting Started

    • Initializing Pygame
    • Displaying Stuff

    The Game Loop


    Chapter 20 Image-ine the Possibilities

    • Files and Folders
    • Setting the Background
    • Placing the Cars


    Chapter 21 We Like to Move It

    • Moving the Enemy
    • Moving the Player


    Chapter 22 Crash, Bang, Boom

    • You Crashed, Game Over
    • Tracking Score
    • Increasing Difficulty



    Chapter 23 Finishing Touches

    • Game Over Revisited
    • Pause
    • Varying Enemies
    • Ice Cubes


    Chapter 24 Keep Going

    • Splash Screen
    • Scores and High Scores
    • Oil Slick
    • Multiple Enemies
    • And Then


    What Next?

    There’s a Lot More to Python

    • Web Development
    • Mobile App Development
    • Game Development
    • And Then Index

    Bonus Online Chapter 25 Tinkering, Testing, and Debugging Revisited (Online Only)

  • What grade levels is this text appropriate for?
    Grades 7-12
  • What types of courses is this text best suited for?
    This program is designed for introductory computer programming courses.

PEARSON, MYLAB, REVEL, Pearson Logo are trademarks owned and/or registered by Pearson plc and/or its affiliates. All other third party marks associated with these products are the property of their respective owners. Copyright in the works referenced herein is owned by Pearson Education, Inc. Pearson Education has control over the editorial content in these instructional materials.

Select an Option below:

More Options: