+ 1

How can I do a range netween two numbers,1013 and 2073?

2nd Dec 2018, 9:13 AM
Alexander Hollauf
Alexander Hollauf - avatar
3 Antworten
+ 4
a = range(1013,2073) In the above statement if you print a then the output will be range(1013,2073) But if you want to see the list of number just use typecasting a = (list)(range(1013,2073))
2nd Dec 2018, 10:12 AM
Rishi Anand
Rishi Anand - avatar
+ 4
Rishi, the parentheses around list is not really necessary. list() is a function in Python, so a = list(range(10,21)) works just fine. https://docs.python.org/3/library/functions.html#func-list
2nd Dec 2018, 10:47 AM
Kishalaya Saha
Kishalaya Saha - avatar
+ 2
Kishalaya Saha ya...it's just that m habitual doing this
2nd Dec 2018, 10:50 AM
Rishi Anand
Rishi Anand - avatar