Ad
  • Custom User Avatar
    • elif...:continue Reverse which conditions? Each branch handles a different case, the middle elif block handles the double rotten case. Replacing continue with pass would be equivalent, but the block is required and I'm not sure where you're suggesting I move it to.
    • I wasn't aware of the second parameter next(iterator[, default]), good to know
    • The only interaction with packed in the else clause is appending. The apples variable is iterated through, but only forward from the current position until a complementary box is found which avoids looking backward in the packed list or looking through the whole remaining apples list.