Please enable JavaScript to use CodeHS

Teaching Intro to Computer Science in Python 3

Description

Students will learn how indexing can be used to specify a specific character in a string based on location.

Objective

Students will be able to use indexing in order to find a specific character in a string.

Description

Students will learn how slicing allows them to select multiple string values at once from a given string.

Objective

Students will be able to use slicing to select a chunk of values from a string.

Description

In this lesson, students will look at the use of for loops with strings. Since both string indices and for loops index at zero, the len value can be used to go through strings in a for loop. Indicies don’t need to be explicitly used. The syntax for character in my_string can be used to go through a for loop one character at a time.

Objective

Students will be able to:

  • iterate over characters in a string using for loops
Description

In this lesson, students will see how the in keyword can be used in an if statement to see if a particular letter or substring is in a string.

Objective

Students will be able to:

  • use the in keyword to check if a character is in a string
Description

In this lesson, students will learn about string methods. Methods are basically functions that you call on objects and can be used to alter our strings in different ways.

Objective

Students will be able to:

  • use various string methods to alter string values
Description

In this lesson, students will learn about and practice using tuples. A tuple is a heterogenous, immutable data type that stores an ordered sequence of things that can be accessed using indices.

Objective

Students will be able to:

  • create and store information in tuples
  • explain the characteristics of a tuple
Description

In this lesson, students will learn about their second data structure, lists. A list is a mutable, heterogeneous data type that stores an ordered sequence of things.

Objective

Students will be able to:

  • understand and explain the characteristics of a list
  • use lists to store and recall information
Description

In this lesson, students will learn how lists can be iterated over in a similar way to strings.

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, in general, are like functions that can be called on objects. Students have seen previously how string methods are called on strings. In this lesson, students will learn about the various list methods that can be called on lists!

Objective

Students will be able to:

  • apply useful list methods to alter and access information about a list