Search the courses, subjects, tracks, games and features, or jump straight to a page.
5 cards from this section. Quick, good the night before a test.
What is the output of fruits = ['apple', 'banana', 'mango']; print(fruits[1])?
Remember to check the index starting from 0.
How do you create an empty list in Python?
Use square brackets without any content.
What is the correct way to create a list in Python?
Think about the symbols used to denote different data structures.
True or False: Lists in Python cannot contain duplicate values.
Consider the definition of what makes a list unique.
Write a function that takes a list of numbers as input and returns a new list containing only the even numbers from the given list.
Think about how you can use list comprehension to filter the items.
Create a nested list showing a 3x3 matrix and write a piece of code to change the middle value to zero.
Access the middle item via its row and column indices.
7 more questions in this section. Enroll free to practise them all.
Enroll free