0

Range(3, 8)

Why does list(range(3, 8)) print [3, 4, 5, 6, 7] instead oof [4, 5, 6, 7, 8]? Doesn't lists start at 0?

9th Oct 2016, 10:44 PM
Burnt Wax
Burnt Wax - avatar
1 Odpowiedź
0
From what I can tell you are telling Python to build a list with the range of numbers between 3 & 8. So naturally Python is obeying your command and its printing the list of your range between 3 to 8.
10th Oct 2016, 3:39 AM
Ray
Ray - avatar