Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What is the syntax to create a list containing the numbers 1, 2, and 3?
Remember, lists are enclosed in square brackets.
How would you access the first item in a list?
Think about zero-based indexing.
What type of collection is mutable in Python?
Think about which structure allows changes.
Tuples can be modified after creation. True or False?
Consider the word 'immutable'.
Design a program that asks the user to input five different colors, stores them in a list, and then converts that list into a tuple. Show both the list and tuple.
Use the `tuple()` function to convert your list.
Create a function that accepts a list of integers and returns only those that are odd, stored within a tuple.
Consider using a comprehension for efficiency.
4 more questions in this section. Enroll free to practise them all.
Enroll free