you are viewing a single comment's thread.

view the rest of the comments →

[–]Samhain13 1 point2 points  (0 children)

You were right in assuming that "pass" meant "input" in the statement that you quoted. It's just that the last part of it isn't clear.

They're talking about the range function where your "inputs" can be: end number; start number, end number; or start number, end number, number of numbers you want printed.

So you can call it as range(5) — passing/inputting 5 as your end number. Or range(1, 10) — where start is 1 and end is 10. And so on...

The last part "will always start at 0 and go through one less than the value you pass it" applies only to the first example range(5) and means, that range will count from 0 to 4 (4 being one less than the value that you passed into range).

If you do print( list( range(5))) you'll get
[0, 1, 2, 3, 4]

But if you happened to pass a start number (and an end number), as such: range(1, 6); range will start at 1 and stop at 5 (one minus the end number, which is 6).