Solved What if there are fewer than five readings? BEBellaRossiOP 12 Sep, 12:44 Not in the task, but curious: does [-5:] crash on a short list?
GRGrace_4212 Sep, 16:14 Solutionreplies: 2No — slices never raise IndexError. On a list with 3 items, [-5:] just returns all 3. That's one of the nice properties of slicing compared to indexing.
CHCharlieH14 Sep, 09:48Stage 2's {change:+d} was new for me. The plus sign for positive numbers is a nice touch.
Comments 4
Join the discussion CommentAlready have an account? Log in
No — slices never raise IndexError. On a list with 3 items,
[-5:]just returns all 3. That's one of the nice properties of slicing compared to indexing.Great, no special case needed.
Same, I didn't know you could force the sign in a format spec.
Stage 2's
{change:+d}was new for me. The plus sign for positive numbers is a nice touch.