Learn

Now that we know how to create and access list data, we can start to explore additional ways of working with lists.

In this lesson, you’ll learn how to:

  • Add and remove items from a list using a specific index.
  • Create lists with continuous values.
  • Get the length of a list.
  • Select portions of a list (called slicing).
  • Count the number of times that an element appears in a list.
  • Sort a list of items.

Note: In some of the exercises, we will be using built-in functions in Python. If you haven’t yet explored the concept of a function, it may look a bit new. Below we compare it to the method syntax we learned in the earlier lesson.

Here is a preview:

# Example syntax for methods list.method(input) # Example syntax for a built-in function builtinfuncion(input)

Instructions

Take a second to preview some of the things we will be learning by examining the graphic of common list methods and built-in functions.

When you’re ready, continue to the next exercise.

Sign up to start coding

By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.
Already have an account?