1. เรียนรู้
  2. /
  3. Courses
  4. /
  5. Introduction to Python

Connected

Exercises

Create a list

A list is a compound data type; you can group values together, like this:

a = "is"
b = "nice"
my_list = ["my", "list", a, b]

After measuring the height of your family, you decide to collect some information on the house you're living in. The areas of the different parts of your house are stored in separate variables in the exercise.

คำแนะนำ

100 XP
  • Create a list, areas, that contains the area of the hallway (hall), kitchen (kit), living room (liv), bedroom (bed) and bathroom (bath), in this order. Use the predefined variables.
  • Print areas with the print() function.