range does not work the same for 2.7 and my 3.6.5. Seems they have changed the nature of range. It is a built in listed along with lists and tuples

list(range(10))
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

>>> tuple(range(10))
(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)

seems they have changed range for python3.6.5 I do not know about the earlier python3 versions.  range(10) will not work with python3.6.5

check out https://docs.python.org/3.6/library/stdtypes.html#typesseq

On 05/11/2018 12:58 PM, David Rock wrote:
On May 9, 2018, at 07:14, kevin hulshof <kevinhuls...@live.nl> wrote:

Hello,

Is there a function that allows you to grab the numbers between two numbers?

Eg. If you input the numbers 1 and 4
To make a list like this [1,2,3,4]
One option is range

range(1,5)

range(1,5)
[1, 2, 3, 4]

https://docs.python.org/2/library/functions.html#range

—
David Rock
da...@graniteweb.com




_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to