What is the base index number for lists in Python?

Understanding List Indexing and Slicing in Python

Quiz
•
Computers
•
10th Grade
•
Medium

Savannah Graziano
Used 5+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
None of the above
1
0
-1
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you access the last element of a list named 'a'?
a[0]
a[last]
a[-1]
a[len(a)-1]
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What error is raised if you use an index that is out of range?
ValueError
TypeError
IndexError
SyntaxError
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you slice a list 'a' from index 2 to 4 (inclusive of 2 but not 4)?
a[2,4]
a[2]-a[4]
a[2:4]
a[2:5]
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does negative indexing allow you to do?
Access elements from the end of the list
None of the above
Delete elements from the list
Multiply list elements
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the slice 'a[::2]' do?
Reverses the list
Duplicates the list
Selects every second element from the list
Clears the list
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will 'a[:-1]' return?
An empty list
A copy of the list without the last element
The last element of the list
A reversed copy of the list
Create a free account and access millions of resources
Similar Resources on Wayground
9 questions
OCR GCSE CS - 2.1 ERL sorts and searches

Quiz
•
10th - 11th Grade
11 questions
Python Arrays

Quiz
•
9th - 10th Grade
12 questions
FoP Unit 8 Lists Pre-Assessment

Quiz
•
10th Grade
12 questions
Code.org Unit 6 - Lists

Quiz
•
9th - 12th Grade
15 questions
2D Arrays

Quiz
•
9th - 12th Grade
15 questions
Python Lists

Quiz
•
8th - 12th Grade
13 questions
Python List Operations

Quiz
•
10th Grade
10 questions
Python Level 2- Lesson 2

Quiz
•
10th Grade
Popular Resources on Wayground
25 questions
Equations of Circles

Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)

Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System

Quiz
•
10th Grade
10 questions
Writing and Identifying Ratios Practice

Quiz
•
5th - 6th Grade
36 questions
Prime and Composite Numbers

Quiz
•
5th Grade
14 questions
Exterior and Interior angles of Polygons

Quiz
•
8th Grade
37 questions
Camp Re-cap Week 1 (no regression)

Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review

Quiz
•
10th Grade