xrange function takes three arguments: start , stop and step . It returns a range of numbers, starting with start , continuing with stop , but not including it. If "start" is greater than stop , a negative step must be provided.
So basically xrange(999, 100, -1) will give you [999, 998, ..., 101]
source share