0

In which case range(1,10) indicates value 1-9 and when 1-10. please explain.

4th Oct 2018, 1:11 AM
partha
partha - avatar
3 Answers
+ 2
A range accepts 2 arguments, the beginning and the end, but the end is not included, so range(1,10) means 1-9, to get a range of 1-10 use range(1,11).
4th Oct 2018, 1:29 AM
Ipang
+ 2
You're welcome Partha, been there too, no worries, mistakes are part of learning : )
4th Oct 2018, 10:09 AM
Ipang
+ 1
thanks Ipang actually there was some misunderstanding on my side lol
4th Oct 2018, 8:37 AM
partha
partha - avatar