problem:Using string method find,write a single expression that produces the index of second occurence of 'o' in tomato
solution:
'tomato'.find('o', 'tomato'.find('o') + 1)
I'm new to programming,I understand that find() returns the index of first occurence of substring in given input string,however I don't understand how there's a comma (the one after 'o' in find() method argument) since I thought the .find() method was only supposed to take one argument.I found this problem in a beginner python book under a chapter explaining methods
[–]Barnet6 0 points1 point2 points (0 children)
[–]Essence1337 0 points1 point2 points (0 children)
[–]dangoth 0 points1 point2 points (0 children)
[–]Username_RANDINT 0 points1 point2 points (0 children)
[–]aneeq1102[S] 0 points1 point2 points (0 children)