Practice - Assignment and Reference
Practice Questions
Test your understanding with targeted questions
What is the resulting value of list1 = [10, 20, 30]; list2 = list1; list1[1] = 99? What does list2 show?
💡 Hint: Remember that lists are mutable.
What does the expression 'factors[1]' return for factors = [1, 2, 3, 4]?
💡 Hint: Think about zero-based indexing.
4 more questions available
Interactive Quizzes
Quick quizzes to reinforce your learning
What will the output of the following code be?
list1 = [10, 20, 30]; list2 = list1; list1[0] = 100;
print(list2)?
💡 Hint: Remember how assignment works with mutable types.
True or False: Lists in Python can only contain elements of the same data type.
💡 Hint: Think about how you can mix data types in a single list.
Get performance evaluation
Challenge Problems
Push your limits with advanced challenges
Create a nested list that consists of three teams, each with three members. Then, replace the name of a member in the second team and print the updated list.
💡 Hint: Remember to access using multiple indices for the nested structure.
Given the list my_list = [0, 1, 2, 3, 4, 5], write a function to return a new list that contains only even numbers.
💡 Hint: Consider using list comprehension for this task.
Get performance evaluation
Reference links
Supplementary resources to enhance your learning experience.