• Python question of the day

    What would be the output of executing the following code:
    s = 'apple'
    print(s.find('p') + s.rfind('f') + s.find(''))
    find method returns the lowest index in the string where substring is found. Returns -1 if substring is not found. Returns 0 if substring is null

    Top 100 python interview questions:

  • python bootcamp 2021
datai analytics