I wanted getting indexes where "i" is in "Mississippi" but the results aren't as expected pls help me get what the error is | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I wanted getting indexes where "i" is in "Mississippi" but the results aren't as expected pls help me get what the error is

https://code.sololearn.com/cpyaHIlnZx9p/?ref=app

9th Nov 2018, 10:47 AM
partha
partha - avatar
5 Answers
+ 2
https://code.sololearn.com/c5AOlTI6Pecn/?ref=app
9th Nov 2018, 11:18 AM
Amir Galanty
Amir Galanty - avatar
9th Nov 2018, 11:48 AM
Amir Galanty
Amir Galanty - avatar
0
thanks Amir Galanty I realised later that I was printing k as i everytime (that's why giving same index value everytime)lol
9th Nov 2018, 12:49 PM
partha
partha - avatar
0
hey Amir Galanty can you explain the second one (can't understand how len is used there for this purpose?)
12th Nov 2018, 12:55 AM
partha
partha - avatar
0
range(len(l)) create a range of 0 to (size of l)-1
12th Nov 2018, 1:06 AM
Amir Galanty
Amir Galanty - avatar