Q. Write a loop that prints out the index of every ‘i’ in ‘Mississippi’.

Answer :-

str = "Mississippi"
for i in range (len (str)) :
    if str[ i ] == 'i' :
        print (i)

Output:-

1
4
7
10
>>>

4 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post