About range() | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

About range()

for example like range(1,6), do the numbers include 1 and 6

1st Aug 2017, 4:03 AM
Carson Feng
Carson Feng - avatar
2 Answers
+ 9
range() doesn't include second parameter. range(1, 6) => 1 2 3 4 5
1st Aug 2017, 4:08 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 2
includes 1 and excludes 6.
1st Aug 2017, 4:09 AM
Venkatesh Pitta
Venkatesh Pitta - avatar