How to get the first index of a substring inside a string with Python

1 Answer

0 votes
string = 'php python java c python c++ python'

index = string.find('python')

print(index)
 
 
 
 
'''
run:
 
4
 
'''

 



answered Feb 8, 2021 by avibootz
...