Unless I\'m mistaken, a range can only include unique numbers. So, a number could be in it or not.
I guess only if we want to pass a range as one of many accepted t
Because range()
objects conform to the Sequence ABC, and that ABC has a .count()
method.
In other words, it is there for completeness sake, so that the object qualifies as a sequence.
It doesn't have to go across the whole range as it is easy enough to calculate if the number is part of the sequence, see Why is `1000000000000000 in range(1000000000000001)` so fast?