Course Title: Python 2

Curriculum Description: This twenty-lesson module is a continuation of Python 1. Students advance their learning to include functions, events, and basic elements of game design.

Prerequisites: Python 1

Course Content:

This twenty-lesson module is a continuation of Python 1. Python 2 uses the same single-lesson project model as Python 1 to engage and motivate all students as it builds on the core concepts of programming. Topics include: indexing, algorithms, string manipulation, while loops, events, booleans, program design, and game mechanics. Students create a final project at course completion.

 

Assessment Tools

 

  • Auto graded lessons
  • Multiple Choice - Formative Assessments
  • Project work graded by rubric
  • Final project

Standards addressed in all lessons:

Each lesson includes components that address these standards.  

 

Skill Building:

  • CSTA 2-AP-11: Create clearly named variables that represent different data types and perform operations on their values.

  • CSTA 2-AP-13: Decompose problems and subproblems into parts to facilitate the design, implementation, and review of programs.

Debugging:

  • CSTA 2-AP-17: Systematically test and refine programs using a range of test cases.

Create Projects:

  • CSTA 2-AP-15: Seek and incorporate feedback from team members and users to refine a solution that meets user needs.

Student Activities: How is learning demonstrated?

Lessons are based on a differentiated instruction model with multiple exit points:

 

Skill Build – Learn new concepts to create a project following a step-by-step approach.

Modify – Apply learned concepts to modify and add to the existing project.

Create – Show mastery by building a real-world relevant project on their own or as part of a team.

Lesson 1 - All Mixed Up

 

Use list indexes to set the stage background and customize a sprite.

 

Create Project: Generate random band names from lists of words.

Standards:

 

2-AP-11: Use Variables

Learning Targets:

  • Use a list to store a collection of strings.

  • Use a variable to name and store a list.

  • Choose the first item in a list using a 0 index.

  • Access individual items from a list using the index.

Lesson 2 - Password Generator

 

Generate unique passwords using user input, indexes and list commands.

 

Create Project: Create a custom password generating algorithm and create it using code.

Standards:

 

2-NI-05: Protect  Information

 

2-AP-10: Flowcharts & Pseudocode

 

2-AP-11: Use Variables

 

2-AP-13: Decomposition

Learning Targets:

  • Access individual items from a list or string using the index.

  • Choose the last item in a list or string using a negative index.

  • Create an algorithm.

  • Understand an algorithm.

Lesson 3 - Play Again

 

Use a while loop, click event, and for loop to create a game that increases the difficulty with every level.

 

Create Project: Make a game or animation program that repeats until the user breaks the loop.

Standards:

 

2-AP-11: Use Variables

 

2-AP-12: Control Structures

 

2-AP-13: Decomposition

Learning Targets

  • Use while loops to iterate an indeterminate number of times.

  • Identify and change the condition of a while loop.

  • Prevent an infinite loop error.

Lesson 4 - Word Solve

 

Use nested loops, membership operators, lists, and indexes to create a game that lets users guess a word letter by letter.

 

Create Project: Use string methods to create a string manipulation program; i.e. leet or sTiCkYcApS.

Standards:

 

2-DA-08: Data Visualization

 

2-AP-11: Use Variables


2-AP-12: Control Structures

 

2-AP-13: Decomposition

 

Learning Targets:

  • Use the math operator * to duplicate a string a specified number of times.

  • Find the position of a value in a list using .index()

  • Use the membership operator in to test if specific values are in a list.

  • Use while loops to iterate an indeterminate number of times.

  • Identify and change the condition of a while loop.

  • Prevent an infinite loop error.

  • Use break and continue statements in loops.

Lesson 5 - Changing Scenes

 

Set the scenes of a story by using functions and calling them at the right times.

 

Create Project: Use functions to show information on countries around the world.

Standards:

 

2-AP-11: Use Variables

 

2-AP-14: Functions

Learning Targets:

  • Create and name a  function and add commands.

  • Follow the rules and naming conventions for functions.

  • Understand that code within a function does not run until the function is called.
  • Understand that whitespace / indentation defines what is inside of a function.

     

Lesson 6 - Dance Moves

 

Choreograph a dance routine by calling functions in order.

 

Create Project: Apply actions to functions to simulate athletes playing a sport.

Standards:

 

2-AP-11: Use Variables

 

2-AP-14: Functions

Learning Targets:

  • Create and name a  function and add commands.

  • Follow the rules and naming conventions for functions.

  • Understand that code within a function does not run until the function is called.

  • Understand that whitespace / indentation defines what is inside of a function.

  • Use functions to shorten their programs and avoid repetition.

Lesson 7 - Dance Off

 

Control a dance routine by using key events to perform dance moves.

 

Create Project: Make an Etch-a-Sketch toy controlled by key events.

Standards:

 

2-AP-11: Use Variables

 

2-AP-13: Decomposition

 

2-AP-14: Functions

 

Learning Targets:

  • Create an event and event handler.

  • Identify the signal that runs an event.

  • Add commands to events

  • Assign a specific key to signal an event

  • Trigger events using keys on the keyboard

Lesson 8 - Math Machine

 

Allow users to choose a math operation and supply numbers to the program to calculate the results.

 

Create Project: Code a custom choose-your-own adventure.

Standards:

 

2-AP-11: Use Variables

 

2-AP-12: Control Structures

 

2-AP-13: Decomposition

 

2-AP-14: Functions

Learning Targets:

  • Use the Python pass keyword to define an empty function without syntax errors.
  • Use basic math operators to add, subtract, multiply, and divide.
  • Store the results of a mathematical formula in a variable.
  • Use conditionals to call functions.
  • Use the math operator modulo % to calculate remainders.

Lesson 9 - Refactoring 1

 

Review various types of loops and functions and how they can be used to make programs more readable and efficient.

Standards:

 

2-AP-11: Use Variables

 

2-AP-12: Control Structures

 

2-AP-13: Decomposition

 

2-AP-14: Functions

Learning Targets:

  • Understand the meaning and usefulness of refactoring.

  • Use different types of loops to eliminate repetitive code.

  • Use functions to make programs more efficient and readable.
  • Use functions and loops together to create code that is concise and easy to edit.
  • Evaluate and edit another programmer's code.

Lesson 10 - Party Invitation

 

Fill out party invitations by calling functions with parameters.

 

Create Project: Make an e-card for any occasion.

Standards:

 

2-AP-11: Use Variables

 

2-AP-13: Decomposition

 

2-AP-14: Functions

Learning Targets:

  • Define a function with parameters.

  • Call a function with parameter values.
  • Call a function with parameters more than once, using different parameter values each time.

Lesson 11 - Around the Solar System

 

Calculate weights on different planets using functions with return statements.

 

Create Project: Convert between two sets of measurements using functions and returns.

Standards:

 

2-AP-11: Use Variables

 

2-AP-13: Decomposition

 

2-AP-14: Functions

Learning Targets:

  • Define a function with a parameter and return.

  • Use a return statement to pass a value from a function back to the main program.

  • Use a return variable to store the return value from a function call.

  • Use math operations inside a function to return a numeric result.

  • Use variable displays and to display and update variable values.

Lesson 12 - Secret Code

 

Translate words into coded Pig Latin using a function with a return statement.

 

Create Project: Design and create an encryption program.

Standards:

 

2-NI-06: Encryption

 

2-AP-11: Use Variables

 

2-AP-13: Decomposition

 

2-AP-14: Functions

Learning Targets:

  • Define a function with a parameter and return.

  • Use a return variable to store the return value from a function call.

  • Use a return variable to store the return value from a function call
  • Use list() to cast a string to a list
  • Access individual items from a list using the index
  • Use a loop to concatenate a list of string values into one string

Lesson 13 - Stick Figures

 

Draw stick figures using a function, then animate the stick figures using another function.

 

Create Project: Design an animated logo.

Standards:

 

2-AP-11: Use Variables

 

2-AP-12: Control Structures

 

2-AP-13: Decomposition

 

2-AP-14: Functions

Learning Targets:

  • Define a function with a parameter and return.
  • Use a list to store a collection of sprites.
  • Call a function with parameters more than once, using different parameter values each time.
  • Pass the return value of one function into another function as the parameter.
  • Assign actions to all sprites stored in a list using a loop.

Lesson 14 - Leap Year

 

Calculate if a year is a leap year or not using logical operators and Boolean values.

 

Create Project: Build playlists using lists and boolean expressions to choose the correct playlist.

Standards:

 

2-AP-11: Use Variables

 

2-AP-12: Control Structures

 

2-AP-13: Decomposition

 

2-AP-14: Functions

Learning Targets:

  • Use and identify the Boolean data type.
  • Output variables and variable data types to the console.
  • Combine logical statements with logical operators.
  • Use the math operator modulo % to calculate remainders.

Lesson 15 - Refactoring 2

 

Review various types of loops and functions and how they can be used to make programs more readable and efficient.

Standards:

 

2-AP-11: Use Variables

 

2-AP-12: Control Structures

 

2-AP-13: Decomposition

 

2-AP-14: Functions

Learning Targets:

  • Understand the meaning and usefulness of refactoring.
  • Use different types of loops to eliminate repetitive code.
  • Use functions and loops together to create code that is concise and easy to edit.

  • Use functions with parameters and returns to make programs more efficient and readable.
  • Evaluate and edit another programmer's code.

Lesson 16 - Astronaut Rescue

 

Build a game using collision events to detect objects to avoid or collect.

 

Create Project: Design a maze game that ends when the user hits an obstacle or the goal.

Standards:

 

2-AP-11: Use Variables

 

2-AP-12: Control Structures

 

2-AP-13: Decomposition

 

2-AP-14: Functions

Learning Targets:

  • Define a sprite as hazard or goal.

  • Use if statements to define actions after a collision.

  • Use an event handler to assign an event to a particular sprite.

Lesson 17 - Save the Moon!

 

Build a game with a global variable to keep track of the score.

 

Create Project: Design a falling object game with scoring.

Standards:

 

2-AP-11: Use Variables

 

2-AP-12: Control Structures

 

2-AP-13: Decomposition

 

2-AP-14: Functions

Learning Targets:

  • Use the global keyword to change the scope of a variable.

  • Use stage physics and an interval event to establish a goal object.

  • Change timing for an interval event. 

  • Add value to a variable to keep score.

Lesson 18 - Wizard Duel

 

Build a game where a wizard duels an evil wizard by calling multiple functions and passing return values through multiple functions.

 

Create Project: Design a new spell for the dueling wizards.

.

Standards:

 

2-AP-11: Use Variables

 

2-AP-12: Control Structures

 

2-AP-13: Decomposition

 

2-AP-14: Functions

Learning Targets:

  • Call functions from within other functions.
  • Pass information through multiple functions using parameters.
  • Return information through multiple functions using returns.
  • Evaluate and edit another programmer's code.

Lesson 19 - Concept Review

 

Practice the coding skills and concepts learned in the previous lessons by completing a series of puzzles and activities.

Standards:

 

2-AP-11: Use Variables

 

2-AP-12: Control Structures

 

2-AP-13: Decomposition

 

2-AP-14: Functions

Learning Targets:

  • All prior learning targets.

Lesson 20a - Final: Brick Breaker

 

Practice making a Brick Breaker game before making one's own.

Standards:

 

2-AP-11: Use Variables

 

2-AP-12: Control Structures

 

2-AP-13: Decomposition

 

2-AP-14: Functions

Learning Targets:

  • Initialize an empty list.

  • Use a list to store a collection of sprites.

  • Use nested loops to create an array of sprites on the stage.

  • Use an event to make the program interactive.

  • Use if statements to define actions after a collision.

  • Use conditionals to produce different results depending on different input.

Lesson 20a - Final: YOUR Brick Breaker

 

Design a Brick Breaker game using concepts covered in previous lessons.

Standards:

 

2-AP-11: Use Variables

 

2-AP-12: Control Structures

 

2-AP-13: Decomposition

 

2-AP-14: Functions

Learning Targets:

  • Initialize an empty list.

  • Use a list to store a collection of sprites.

  • Use nested loops to create an array of sprites on the stage.

  • Use an event to make the program interactive.

  • Use if statements to define actions after a collision.

  • Use conditionals to produce different results depending on different input.

Create your own Knowledge Base