0
Help. Please explain
x = list(range(5,6)), so x = [5]. why? shouldn't it be [4]?
4 Antworten
+ 2
Brian Gonzalez , the first argument in the range function is the 'start' while the second is the 'stop'.
In your code snippet, the output is x = [5]
Examples:
x = list(range(5,9))
x = [5, 6, 7, 8]
x = list(range(5))
x = [0, 1, 2, 3 ,4]
If there's only one argument, like the above example, that will be the stop and the start will be 0.
+ 1
Thank you😄
0
Just read the lesson again and understood. I'm dumb
0
You're welcome.👍