Solved range(10, -1, -1) — why -1 as the stop? CHCharlieHOP 29 Sep, 07:56 I expected range(10, 0, -1).
JAJackStack29 Sep, 10:44 Solutionreplies: 1The stop is excluded, so to include 0 the stop must be one step past it — and going down, that's -1.
LULucasVD30 Sep, 07:35Stage 2: check the scrub before the hold. Otherwise you print a hold and then scrub, which makes no sense.
Comments 4
Log in to join the discussion.
Log in Create accountThe stop is excluded, so to include 0 the stop must be one step past it — and going down, that's -1.
Ah, same rule as always, just backwards.
reversed(range(11))is another readable option.Stage 2: check the scrub before the hold. Otherwise you print a hold and then scrub, which makes no sense.