Help
Contact
For teachers and institutes
Search courses, problems, tests…
A
A
>_
StemPy Lab
Courses ▾
Problems ▾
Practice ▾
Mock Tests
Classes
Groups
Community ▾
A
A
def last(items): return items[-1]. What does last([]) do? | StemPy Lab
Quizzes
/
def last(items): return items[-1]. What does last([]) do?
Python Programming
Easy
High School (11–12)
High School (9–10)
Undergraduate
General
Python Going Further › Testing and Debugging
Created by
StemPy Lab
def last(items): return items[-1]. What does last([]) do?
Returns 0
Raises an IndexError
Returns None
Returns an empty list
Check Answer
Log in to save
Tag someone
⚑ Report
← All Quizzes
← Which assert method compares 0.1 + 0.2 with 0.3 correctly?
def f(n): return n % 2 == 0. Which input is a good edge case to test? →
More on
Python Going Further › Testing and Debugging
Discussion (0)
Log in
to join the discussion.
Loading…
Problems on this topic
Think of a bug that you met while working through this book, or write one on purpose.
Easy
This function should give the average of a list, but gives a wrong answer for [2, 4, 6] (it gives…
Easy
A pipeline has three stages. For the input "Hello, World", it should give ["hello", "world"], but…
Medium
Write three properties that must be true for any list x and the function reversed_list(x) that…
Medium
All problems on this topic →