Please enable JavaScript to use CodeHS

South Carolina Computer Programming 2 with Python

Description

We define what “code” is, find examples in the real world, and learn about programming as one specific example of code.

Objective

Students will be able to explain what code is in their own words, and provide examples of code in their lives.

Description

We learn about some of the applications of computer programs.

Objective

Students understand why programming is a useful skill, and can explain ways in which programs are being used today. Students will be able to analyze the positive and negative effects of programs and communicate their findings to their classmates.

Description

In this lesson, students will learn how to print messages out onto the console using the Python command print.

Objective

Students will be able to:

  • Write a Python program by typing commands with proper syntax
  • Write a program that prints out a message to the user
Description

In this lesson, students learn how to assign values to variables, manipulate those variable values, and use them in program statements. This is the introductory lesson into how data can be stored in variables.

Objective

Students will be able to:

  • Explain what variables are and what they are used for
  • Use the different types of variables in Python
  • Distinguish between declaring, initializing and assigning variables
  • Create their own variables with proper naming conventions
  • Print out the values stored in variables
Description

In this lesson, students learn how they can allow users to input information into their programs, and use that input accordingly.

Objective

Students will be able to:

  • Create programs that ask the user for input
  • Store user input in variables and print it back to the user
  • Choose the proper input function to use depending on the type of information needed
Description

In this lesson, students learn about the different mathematical operators they can use to perform mathematical computations and create useful programs that compute information for the user.

Objective

Students will be able to:

  • Describe the different mathematical operators we can use in programs
  • Create programs that use basic math to compute useful things
  • Create programs that take in user input, do simple computations with the input, and produce useful output
Description

In this lesson, students will learn the basics of creating graphics objects. Graphic creation relies on setting the type, shape, size, position, and color on the artist’s canvas before adding to the screen. Using geometric concepts, multiple graphic objects can be created in Python.

Objective

Students will be able to:

  • Create graphical Python programs that draw shapes on the canvas
  • Locate points on the graphics canvas using (x, y) coordinates
Description

In this lesson, students will use what they have learned in the Programming with Python module to draw a design of their own creation!

Objective

Students will be able to…

  • Synthesize the skills and concepts from the Python and Graphics
  • Break down a large problem into smaller parts using Top Down Design, and solve each of these smaller parts using functions
  • Create helpful comments with preconditions and postconditions to help the reader understand the code
  • Find and fix bugs in large programs
Description

In this lesson, students are introduced to a way input can be taken from the user’s mouse using the mouse clicked method.

Objective

Students will be able to:

  • Describe how events are different than timers
  • Use mouse click events to create programs that respond to user clicks
Description

In this lesson, students review content with a 15 question Unit Quiz.

Objective

Students will be able to:

  • Prove their knowledge of basic coding concepts through a multiple choice quiz
Description

In this lesson, students will learn more about boolean values. Booleans refer to a value that is either true or false, and are used to test whether a specific condition is true or false.

Objective

Students will be able to:

  • Create boolean variables to represent meaningful yes/no values
  • Print out the value of a boolean variable

Enduring Understandings

This lesson builds toward the following Enduring Understandings (EUs) and Learning Objectives (LOs). Students should understand that…

  • EU 4.1 Algorithms are precise sequences of instructions for processes that can be executed by a computer and are implemented using programming languages. (LO 4.1.1)
  • EU 5.5 Programming uses mathematical and logical concepts. (LO 5.5.1)
Description

In this lesson, students will learn about logical operators. Logical operators allow students to connect or modify Boolean expressions. Three logical operators are and, or, and not.

Objective

Students will be able to:

  • Describe the meaning and usage of each logical operator: or, and, and not.
  • Construct logical statements using boolean variables and logical operators
Description

In this lesson, students learn how to use comparison operators. Comparison operators let students compare two values.

Objective

Students will be able to:

  • Explain the meaning of each of the comparison operators (<, <=, >, >=, ==, !=)
  • Create programs using the comparison operators to compare values
  • Predict the boolean result of comparing two values
  • Print out the boolean result of comparing values
Description

In this lesson, students learn about if statements as a way to make decisions and execute specific code depending on the validity of a condition.

Objective

Students will be able to:

  • Explain the purpose of if statements
  • Create their own if statements to selective choose which code is executed in their programs
Description

In this lesson, students will learn how to use keyboard keys to control events. Keyboard events capture when the user presses keys on the keyboard. This allows students to write programs that take input from the keyboard to change what is happening in the program.

Objective

Students will be able to:

  • Create interactive programs that use events to respond to the keyboard input.
Description

In this lesson, students will learn in greater detail about for loops. For loops in Python are written and executed in the same manner as Karel exercises, except now students will explore modifying the initialization statement, test statement, and increment statements of the loops.

Objective

Students will be able to:

  • Create for loops in Python
  • Explain the purpose of for loops
  • Utilize for loops to avoid typing out repeated code
  • Use the loop counter i inside the for loop code to do something different on each iteration
Description

In this lesson, students will explore in more detail how they can modify the initialization statement, test statement, and increment statement in a for loop.

Objective

Students will be able to:

  • Explain the different parameters of the range function (starting value, ending value, and incrementer)
  • Create for loops that iterate differently than the basic for loop structure (ie count by twos or count backwards)
Description

In this lesson, students will learn how to create for loops to solve increasingly challenging problems by using nested for loops and branching control structures.

Objective

Students will be able to:

  • Explain the purpose of for loops
  • Create for loops to solve increasingly challenging problems
  • Create nested for loops
Description

In this lesson, students will learn how random numbers can enhance a program and be used in combination with various control structures.

Objective

Students will be able to:

  • Explain why random numbers are a useful part of computer programs
  • Create random values in a program
  • Utilize the DOCS for the Random Numbers function in order to learn how to generate random values
Description

In this lesson, students will explore while loops and Python variables. This combines the ideas of creating variables, updating variables throughout a loop, and determining the correct ending condition.

Objective

Students will be able to:

  • Explain the purpose of a while loop
  • Create while loops to repeat code while a condition is true
  • Utilize while loops to solve new types of problems
Description

In this lesson, students will learn how to create a Loop and Half. A Loop and a Half is a specific way to write a while loop with the condition being True. Inside the loop, students create a SENTINEL value to break out of the loop whenever that condition is met, causing the loop to end.

Objective

Students will be able to:

  • Explain how the loop-and-a-half structure is different from a traditional while loop
  • Explain what an infinite loop is
  • Explain what the break statement does
  • Create programs that use the loop-and-a-half structure to repeat code until a SENTINEL is met, causing the program to break out of the loop
Description

In this lesson, students will apply everything they learned in the Control Structures module.

Objective

Students will be able to…

  • Synthesize the skills and concepts from the Python Control Structures module
  • Break down a large problem into smaller parts using Top Down Design, and solve each of these smaller parts using functions
  • Create helpful comments with preconditions and postconditions to help the reader understand the code
  • Find and fix bugs in large programs
Description

In this lesson, students review content with a 15 question Unit Quiz.

Objective

Students will be able to:

  • Prove their knowledge of control structures through a multiple choice quiz
Description

In this lesson, students learn about functions and parameters in the context of Python which builds on their prior knowledge of working with functions in Karel. This lesson focuses specifically on defining and calling functions, and passing simple, single parameters to functions.

Objective

Students will be able to:

  • Explain the purpose of functions
  • Define their own Python functions
  • Utilize (call) their Python functions to solve simple problems
  • Define and call functions that take in parameters as input
Description

In this lesson, students will work with and will define and call their own functions that take in multiple parameters as input and print out output.

Objective

Students will be able to:

  • Explain the purpose of functions
  • Define their own Python functions
  • Utilize (call) their Python functions to solve simple problems
  • Define functions that take in multiple parameters as input, and use print statements for output
Description

In this lesson, students continue working with multiple parameters that create graphics as output which is very useful, since creating several different graphical objects involves writing the same code over and over again (set the size, set the color, set the location, etc).

Objective

Students will be able to:

  • Explain the purpose of functions
  • Define their own Python functions
  • Utilize (call) their Python functions to simplify their graphics programs
  • Identify repeated code that can be simplified with functions and parameters
  • Define functions that take in multiple parameters as input, and create graphics as output
  • Pass parameters of the correct number and type to their defined Python functions
Description

In this lesson, students learn about return values so they can write functions that do some work and send the result back or use later in the program.

Objective

Students will be able to:

  • Explain the purpose of returning a value from a function.
  • Define functions that return values.
  • Create programs that define and call functions with return values and store the result for later use.
Description

In this lesson, students work with and define functions with return values and more than one parameter.

Objective

Students will be able to…

  • Explain the purpose of returning a value from a function.
  • Create functions that return values.
  • Create programs that call functions with return values and use the return values to solve a higher-order problem.
Description

In this lesson we explore the scoping of a variable, which is where the variable is “defined” or where it exists.

Objective

Students will be able to:

  • Identify the scope of a variable
  • Identify which variables are in scope at a given point in a program
Description

In this lesson, students explore Python’s way of handling errors with exceptions.

Objective

Students will be able to:

  • create programs that can gracefully handle exceptions
  • continue to function when an error is raised
Description

In this lesson, students will apply what they learned during the Functions and Parameters module to create their own Ghost drawings.

Objective

Students will be able to…

  • Synthesize the skills and concepts from the Functions and Parameters module
  • Break down a large problem into smaller parts using Top Down Design, and solve each of these smaller parts using functions
  • Create helpful comments with preconditions and postconditions to help the reader understand the code
  • Find and fix bugs in large programs
Description

This lesson is a summative assessment of the unit’s learning objectives.

Objective

Assess student achievement of the learning goals of the unit

Description
  • A tuple is a heterogenous, immutable data type that stores an ordered sequence of things.
  • Heterogenous means that a single tuple can store different types
  • You can access pieces of a tuple using indices
  • You can find the length of a tuple using len
  • You can concatenate tuples with other tuples
Objective

Students will be able to:
* Create and store information in tuples.
* Explain the characteristics of a tuple.

Description
  • A list is a mutable, heterogenous data type that stores an ordered sequence of things.
  • You can convert lists to strings, and strings to lists.
  • You can iterate over lists like you can with strings.
  • A tuple can be stored as one thing in a list.
  • A list can be stored as one thing in a tuple.
Objective

Students will be able to:
* Understand and explain the characteristics of a list.
* Use lists to store and recall information.

Description
  • A list is a mutable, heterogenous data type that stores an ordered sequence of things.
  • You can convert lists to strings, and strings to lists.
  • You can iterate over lists like you can with strings.
  • A tuple can be stored as one thing in a list.
  • A list can be stored as one thing in a tuple.
Objective

Students will be able to:
* Understand and explain the characteristics of a list.
* Use for loops to go through items in a list.

Description
  • Methods are like functions that you call on objects
  • List Methods can be called on lists
Objective

Students will be able to:
* Apply useful list methods to alter and access information about a list.

Description

SWBAT complete a 15 question unit quiz.

Objective

SWBAT complete Unit Quiz.

Description

In this lesson, students are introduced to the concept of design thinking and learn the steps in the design cycle.

Objective

Students will be able to:

  • Define design thinking
  • Name the steps in the design cycle
Description

In this lesson, students will be introduced to prototyping. They will be given guidelines for this step and shown examples in order to successfully create prototypes of their own final project ideas.

Objective

Students will be able to:

  • Explain what prototyping is and why it is an important part of the design process
Description

In this lesson, students will explore the testing step of the design process. They will see good and bad examples of testing practices and will be able to get feedback on their own prototypes before moving into the building process.

Objective

Students will be able to:

  • Describe why testing is an important part of the design process
  • Explore good and bad testing practices in order to receive helpful feedback on their final project ideas
Description

In this final programming module, students will put together all of the concepts learned throughout the course to create a website. They will work with partners or in groups to creatively develop a website that includes aspects from each part of the course.

Objective

Students will be able to:

  • Connect all they’ve learned to create a final website
  • Work in pairs or groups to create a product
Description

In this lesson, we will define what classes and objects are and learn how to break code down in this structure. They will learn how to use the init method to give attributes to objects.

Objective

SWBAT define class and object as well as create them inside their programs.

SWBAT create an init method to give attributes to objects.

Description

In this lesson, we will begin defining and calling methods on objects.

Objective

SWBAT create methods inside class definitions and call them on objects.

Description

In this lesson, we will learn how to override the built-in methods repr and eq in order to define how the object will create a string representation of itself and define equivalence for a specific class.

Objective

SWBAT override the repr method to define how the object will create a string representation of itself.
SWBAT override the eq method to define equivalence for this specific class.

Description

In this lesson, students will learn about operator overloading and how mathematical methods can be redefined by overriding their method in the class definition.

Objective

SWBAT override mathematical operators to redefine the way mathematical functions are performed.

Description

In this lesson, students will learn about the difference between class and instance variables and how they are located.

Objective

SWBAT describe the differences between class and instance variables.

Description

In this lesson, students will learn how to use inheritance to make classes that are given attributes by other classes.

Objective

SWBAT use inheritance to create new classes that are given attributes by another class.

Description

In this lesson, students will explore hidden attributes and why they are used. They will learn how to create getter and setter methods to retrieve and assign values of hidden attributes.

Objective

SWBAT assign hidden attributes in a program.
SWBAT retrieve and assign hidden values by writing and using getter and setter methods.

Description

In this lesson, we explore how attributes are linked between objects and classes and the path they follow based on namespaces.

Objective

SWBAT describe the different namespaces with regards to classes and objects.

Description

In this lesson, we explore different ways to import modules to be used in our programs.

Objective

SWBAT import and use modules in their programs.

Description

Students review content with a 20 question Unit Quiz.

Objective

SWBAT complete Unit Quiz.

Description

In this lesson, students will learn what data science is, what a data scientist does, and the different types of questions that can be asked about data. Students will learn that statistical questions include computations or finding a relationship or pattern.

Objective

Students will be able to:

  • Recognize and formulate statistical questions
  • Think critically about data and its sources
Description

In this lesson, students will learn about the data cycle and apply the first two steps of asking questions and considering data. Students will start a mini-project that spans through the rest of the module by asking a statistical question about a field of interest and gathering and structuring the data. They will also learn about and consider both quantitative and qualitative data.

Objective

Students will be able to:

  • Explain and apply the data cycle
  • Consider data as either quantitative or qualitative
  • Structure data into tables of rows and columns
Description

In this lesson, students will learn the basics of Python programming in the context of data science. This includes how to define and use variables and lists, how to use comparison and logical operators, and the importance of knowing the different data types used in Python.

Objective

Students will be able to:

  • Use the basics of Python in the context of data science
  • Define and use variables and lists
  • Use comparison and logical operators
  • Understand the importance of the different data types used in Python
Description

In this lesson, students will learn about Python modules and libraries and how to implement and use them within the editor.

Objective

Students will be able to:

  • Import and use Python modules and libraries
  • Explain the importance of documentation
  • Read and use documentation
Description

In this lesson, students will learn how to create a use a Pandas Series. They will also learn and explore measures of central tendency including the mean, median, and mode.

Objective

Students will be able to:

  • Create a Series using the Pandas library
  • Compute the mean, median, and mode of a Series
  • Decide whether the mean, median, or mode is the best measure of central tendency for a specific dataset
Description

In this lesson, students will expand their statistical knowledge to include the spread of a dataset. They will learn about and apply measures of spread including standard deviation, variance, range, and interquartile range.

Objective

Students will be able to:

  • Use functions to compute the standard deviation and variance of a Series
  • Use variables, functions, and operators to determine the range and interquartile range of a Series
  • Use functions to plot a boxplot and histogram
  • Understand what the measures of spread mean for a dataset
Description

In this lesson, students will learn how to create a data frame using the Pandas library. They will also learn and use functions to explore a data frame further including which data types are included, the shape of the data frame, the descriptive statistics of the data in each column, and more.

Objective

Students will be able to:

  • Create a data frame using Pandas
  • Explore a data frame using key functions
Description

In this lesson, students will learn how to filter a data frame by selecting and displaying only specific columns. They will also learn how to filter rows displayed by using conditionals. Lastly, students will learn how to change the index used in a data frame and set it to a column of their choice.

Objective

Students will be able to:

  • Filter a data frame by displaying specific columns
  • Filter a data frame using conditionals
  • Set and reset the indices of a data frame
Description

In this lesson, students will define and use functions, along with values in a dataset, to calculate and create new columns of data.

Objective

Students will be able to:

  • Define and use functions
  • Use existing data values to create new columns of data
Description

In this lesson, students will practice collecting, explaining, and presenting the important data and details of their mini-project.

Objective

Students will be able to:

  • Interpret meaning from data
  • Extrapolate and present important details from a dataset
Description

In this lesson, students review content with a 15 question end-of-module quiz.

Objective

Students will be able to:

  • Demonstrate their understanding of Python, Pandas, and data science basics
Description

In this lesson, students will learn how to navigate the digital world safely by understanding common cyber threats and implementing protective measures. Through interactive activities and creative storytelling, students will explore various cyberattacks, their consequences, and strategies for defense. This awareness will empower them to make responsible choices online and protect themselves from cybercrime.

Objective

Students will be able to:

  • Identify and define different types of cyberattacks (malware, viruses, ransomware, spyware, phishing)
  • Explain the importance of preventative measures like antivirus software, updates, HTTPS, and firewalls
  • Analyze real-world examples of phishing attacks and develop strategies for identifying suspicious online activities
Description

In this lesson, students will learn what copyright laws are and how to avoid copyright infringement. They will explore why copyright laws are important and how they protect the creators.

Objective

Students will be able to:

  • Explain what copyright laws are and why they are important
  • Find images they are legally allowed to use in their projects
  • Accurately attribute images they find and want to use
Description

In this lesson, students will learn about ethical and legal considerations in computing and how these can create bias.

Objective

Students will be able to:

  • Explain how bias can be prevented or minimized in computing.
  • Identify ethical and legal considerations when using computing technologies.
Description

In this lesson, students learn about the importance of giving proper attribution when using someone else’s code. Students also learn about the license agreements and the implications of using a third-party resource during program development.

Objective

Students will be able to:

  • Explain how to give proper attribution when using non-user-created resources
  • Document a program that uses non-user-created code and give attribution to the author
  • Explain the difference between open-source and proprietary licenses
  • Explain the benefits and implications of using licensed code
  • Define API
Description

In this lesson, students explore the impacts of being online. Students reflect on social media use and their digital footprint as well as learn how to identify and respond to cyberbullying.

Objective

Students will be able to:

  • Analyze the impact of social media and technology use on the lives of teenagers
  • Explain how one’s digital footprint can impact their future employment options
  • Analyze their own digital footprint and explain how they can maintain a positive digital footprint
  • Define cyberbullying
  • Explain how to respond to cyberbullying
  • (Optional) Choose the best privacy settings to protect their digital footprint and prevent cyberbullying
Description

In this lesson, students will learn about and discuss information literacy. Information literacy is having the ability to find information, evaluate information credibility, and use information effectively.

Objective

Students will be able to:

  • Evaluate the accuracy, relevance, comprehensiveness, appropriateness, and bias of electronic information resources
  • Evaluate quality of digital resources for reliability
  • Reflect on the growth of artificial intelligence in terms of trustworthy content
  • Explore and use search engine keywords and special characters to refine search results
Description

In this project, students explore how integrating hardware and software can solve real world problems. Students go through a problem-solving process where they research a problem and then select the necessary hardware and software to create a device to address the problem. Then, they create a prototype of their system or device and develop a pitch for their innovation.

Objective

Students will be able to:

  • Explain how problems can be solved by integrating hardware and software to create new devices or systems
  • Research and define a problem in preparation to solve the problem with a technological innovation
  • Develop a system/device prototype that integrates hardware and software components to solve a specific problem
  • Justify hardware and software selections
Description

In this lesson, students will look at establishing classroom norms and safety procedures based on school procedures.

Objective

Students will be able to:

  • Develop a set of rules that will create a safe and secure learning environment
  • Articulate the importance of following classroom rules and procedures and the consequences for not following them
Description

In this lesson, students will look at the causes of different workplace accidents and complete a project looking at the various organizations that influence workplace safety rules.

Objective

Students will be able to:

  • Identify the causes of workplace accidents
  • Analyze the different organizations that influence workplace safety rules
Description

In this lesson, students learn about student organizations and the role they can play in their lives as they think about future careers.

Objective

Students will be able to:

  • Describe a student organization and understand what they do
  • Understand how a student organization could help them in their career path
  • Understand what student competitions are
Description

In this lesson, students will explore skills needed to succeed in the 21st-century workplace and reflect on how they can demonstrate these skills in the classroom.

Objective

Students will be able to:

  • Identify the 21st-century skills needed to succeed in the workplace
  • Reflect on how they can further develop these skills in the classroom