Back to Freecodecamp

Step 1

curriculum/challenges/english/blocks/learn-lambda-functions-by-building-an-expense-tracker/66694bfa435cef241f6f9a68.md

latest1.2 KB
Original Source

--description--

Before starting with the project, you are going to learn about lists.

Unlike numbers and strings, a <dfn>list</dfn> is a data type that works as a container for other values:

py
example_list = [1, 2, 3, 4]
empty_list = []

The list is characterized by the square brackets around all the values, and a comma between the values, like: ["A", "happy", "list"]. If the list does not contain any values, then it is an empty list: [].

A list can contain different data types: [1, "Up", ["Down", "Twice"]]. That includes all possible data types. It can also contain another list!

Create a variable called my_list and assign to it an empty list.

--hints--

You should have a variable called my_list.

js
({
    test: () => runPython(`
        assert _Node(_code).has_variable('my_list'), "variable my_list not found"
    `)
})

The variable my_list should have value of an empty list.

js
({
    test: () => runPython(`
        assert _Node(_code).find_variable('my_list').is_equivalent('my_list = []'), "variable my_list is not an empty list"
    `)
})

--seed--

--seed-contents--

py
--fcc-editable-region--

--fcc-editable-region--