Correct coding for the range function

python, range

Solution

There is nothing special about doing it the second way. One reason I can think of would be if you want the `0` to be a place-holder for something else - i.e. if you intend to change it to something else later on, and you include the `0` to indicate that. Other than that, it's simply preference. In my personal opinion, unless you have a good reason to include the `0`, I would stick with `range(10)`.

Just as a note, you should never use `list` as a variable name since it's a built-in function.

Problem

While working on python I've seen 2 different ways to use the range function when we want to create the list starting from 0. ``` list=range(10) list=range(0,10) ``` I know that if we change the 0 for another number the output is different, but in this case, the output is exactly the same. I want to know if it's only a personal decision or is there something more meaningful to use one or the other syntax (memory, debugging, etc).

Original source