nums=list(range(5)) print(nums[4]) answer should be 3. but sololearn is giving answer 4 as correct. nums=[0,1,2,3,4] nums[4] should be 3
9/4/2019 7:58:09 AM
Mugdha Gandhi2 Answers
New AnswerMugdha Gandhi Indexing starts from 0 so nums[0] = 0 (the first element) hence nums[4] = 5th element(if you start counting from 1) which is 4 (nums[4] is 4)
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message