$ ./guess_the_language
Problem Solving — predict the output
Problem Solving — predict the output · hard · #77
What is printed?
print([x for x in range(5) if x % 2][-1])
3
4
1
IndexError
The comprehension keeps the odd numbers [1, 3]; index -1 is the last of them.
Play Problem Solving ▸
◂ #76
all Problem Solving — predict the output questions
#78 ▸