$ ./guess_the_language
Problem Solving — predict the output
Problem Solving — predict the output · medium · #229
What is the output?
a = [1, 2, 3] print(a[10:], a[-10:2])
IndexError
None [1, 2]
[3] [1, 2]
[] [1, 2]
Slices clamp out-of-range bounds instead of raising, unlike plain indexing.
Play Problem Solving ▸
◂ #228
all Problem Solving — predict the output questions
#230 ▸