We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
i guess this will throw an Value Error if e is not found in the string , hence will give a compilation error .
So, instead of using "index()" we can use "find()" which will return -1 if e is not there in the string.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
HackerRank in a String!
You are viewing a single comment's thread. Return to all comments →
i guess this will throw an Value Error if e is not found in the string , hence will give a compilation error . So, instead of using "index()" we can use "find()" which will return -1 if e is not there in the string.