Adaptive Practice
Lists in Python
10 questions • Earn up to 110 XP • First attempt — go for 100%!
0
XP
0
Correct
x1
Combo
Question 1 of 10
⏱ 0:30
Easy
Which of the following is the correct way to create a list in Python?
Easy
What will be the output of the following code?
list1 = [10, 20, 30]
print(list1[1])
Easy
Which method is used to add an element at the end of a list in Python?
Medium
What will be the output of this code?
list1 = [1, 2, 3]
list1.insert(1, 10)
print(list1)
Medium
How can you remove the last element from a list named 'my_list'?
Medium
What will be the output of the following code?
list1 = [5, 10, 15, 20]
print(list1[1:3])
Medium
Which of the following statements is TRUE about lists in Python?
Hard
What will be the output of this code?
list1 = [1, 2, 3]
list2 = list1
list2.append(4)
print(list1)
Hard
How can you create a copy of a list 'a' so that modifying the copy doesn't affect the original?
Hard
Consider the list: numbers = [2, 4, 6, 8, 10]. What will be the output of numbers[-3:-1]?