I am looking for something like range, but one that will allow me to specify the start and the end value, along with how many numbers I need in the collection which I want to use in a similar fashion range is used in for loops.
I am looking for something like range , but one that will allow me
Share
No, there is no built-in function to do what you want. But, you can always define your own
range:And you can using in a for-loop in the same way you would use
range:EDIT: If you want both
startandendto be part of the result, yourmy_rangefunction would be:And in your for-loop: