Solved

range(10, -1, -1) — why -1 as the stop?

CharlieHOP

I expected range(10, 0, -1).

8

Comments 4

Log in to join the discussion.

Log in Create account
  1. JackStack Solutionreplies: 1

    The stop is excluded, so to include 0 the stop must be one step past it — and going down, that's -1.

    12
    1. CharlieHOP

      Ah, same rule as always, just backwards.

      3
    2. OliviaPy

      reversed(range(11)) is another readable option.

      6
      1. LucasVD

        Stage 2: check the scrub before the hold. Otherwise you print a hold and then scrub, which makes no sense.

        2