
Understanding List Indexing in Python
Quiz
•
Computers
•
9th Grade
•
Practice Problem
•
Medium
Anthony Navarro
Used 6+ times
FREE Resource
Enhance your content in a minute
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the index of the first element in a Python list?
0
1
-1
10
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the list `colors = ['red', 'green', 'blue', 'yellow']`, what value does `colors[2]` return?
'red'
'green'
'blue'
'yellow'
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to access the last element of a list named `numbers`?
numbers[0]
numbers[-1]
numbers[1]
numbers[len(numbers)]
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If `fruits = ['apple', 'banana', 'cherry', 'date']`, what does `fruits[-2]` return?
'apple'
'banana'
'cherry'
'date'
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the list `nums = [10, 20, 30, 40, 50]`, which code will print the third element?
print(nums[2])
print(nums[3])
print(nums[1])
print(nums[0])
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Suppose you have `letters = ['a', 'b', 'c', 'd', 'e']`. Which statement will output 'd'?
print(letters[3])
print(letters[4])
print(letters[-1])
print(letters[2])
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If `animals = ['cat', 'dog', 'rabbit', 'hamster']`, which of the following will cause an IndexError?
animals[0]
animals[-1]
animals[4]
animals[2]
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Microsoft SmartArt Graphics
Quiz
•
8th - 10th Grade
10 questions
Kisi-kisi UTS
Quiz
•
9th - 12th Grade
10 questions
Shortcuts
Quiz
•
5th - 10th Grade
10 questions
UTK - test
Quiz
•
KG - University
12 questions
MAC KEYBOARD
Quiz
•
3rd - 9th Grade
12 questions
Functions With Return Values U1M2 Python
Quiz
•
9th - 12th Grade
10 questions
Year 8 Networks
Quiz
•
6th - 9th Grade
10 questions
ICT DEVICES
Quiz
•
7th - 9th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
