range 10 python code example Example: when do we use *range in python print([*range(20)]) #will give all numbers 1 to 19 in a list