Lists can contain more than just numbers.

Let’s revisit our classroom example with heights:

  • Noelle is 61 inches tall
  • Ava is 70 inches tall
  • Sam is 67 inches tall
  • Mia is 64 inches tall

Instead of storing each student’s height, we can make a list that contains their names:

names = ["Noelle", "Ava", "Sam", "Mia"]

We can even combine multiple data types in one list. For example, this list contains both a string and an integer:

mixed_list_string_number = ["Noelle", 61]

Lists can contain any data type in Python! For example, this list contains a string, integer, boolean, and float.

mixed_list_common = ["Mia", 27, False, 0.5]

Let’s experiment with different data types in our own lists!



Add any additional string to the end of the list ints_and_strings.


Create a new list called sam_height_and_testscore that contains:

  1. The string "Sam" (to represent Sam’s name)
  2. The number 67 (to represent Sam’s height)
  3. The float 85.5 (to represent Sam’s score)
  4. The boolean True (to represent Sam passing the test)

Make sure to write the elements in exact order.

Sign up to start coding

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?