Recall & Review
beginner Click to reveal answer
What is a list in Python?
A list in Python is a collection of items that are ordered and changeable. You can store multiple values in one variable.
beginner Click to reveal answer
How do you create an empty list in Python?
You create an empty list by using square brackets with nothing inside:
[].beginner Click to reveal answer
What will be the output of
print([1, 2, 3])?The output will be
[1, 2, 3]. It shows the list with its elements inside square brackets separated by commas.intermediate Click to reveal answer
How can you create a list with different types of items?
You can put different types of items inside a list, like numbers, strings, or even other lists:
[1, 'apple', 3.14, [2, 3]].beginner Click to reveal answer
What does the list
['a', 'b', 'c'] represent?It represents a list of three string items: 'a', 'b', and 'c'. Lists keep the order of items as they are written.
Which symbol is used to create a list in Python?
✗ Incorrect
Lists in Python are created using square brackets, like
[1, 2, 3].What will
print([]) output?✗ Incorrect
An empty list is shown as
[] when printed.Can a Python list contain items of different types?
✗ Incorrect
Python lists can contain any mix of types, like numbers, strings, or other lists.
What is the output of
print([1, 2, 3][0])?✗ Incorrect
The first item in the list is at position 0, so
[1, 2, 3][0] is 1.How do you represent a list with three string items 'a', 'b', and 'c'?
✗ Incorrect
Lists use square brackets and strings are in quotes:
['a', 'b', 'c'].Explain how to create a list in Python and how it is shown when printed.
Think about the symbols and how items are arranged inside.
You got /4 concepts.
Describe what an empty list is and how you can create one.
It's like an empty box waiting to be filled.
You got /3 concepts.
