range implementation in python