Practice Assignment And Reference (7.2.7) - Lists - Part A - Data Structures and Algorithms in Python
Students

Academic Programs

AI-powered learning for grades 8-12, aligned with major curricula

Professional

Professional Courses

Industry-relevant training in Business, Technology, and Design

Games

Interactive Games

Fun games to boost memory, math, typing, and English skills

Assignment and Reference

Practice - Assignment and Reference

Learning

Practice Questions

Test your understanding with targeted questions

Question 1 Easy

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.

Question 2 Easy

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

Question 1

What will the output of the following code be?
list1 = [10, 20, 30]; list2 = list1; list1[0] = 100;
print(list2)?

[10
20
30]
[100
20
30]
[10
100
30]

💡 Hint: Remember how assignment works with mutable types.

Question 2

True or False: Lists in Python can only contain elements of the same data type.

True
False

💡 Hint: Think about how you can mix data types in a single list.

Get performance evaluation

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

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.

Challenge 2 Hard

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.