Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. def f(string, substring):
  2.     for i in range(len(string)):
  3.         if substring[0] == string[i] and substring in string:
  4.             return i
  5.     return -1
  6.  
  7.  
  8. print(f('ahoj', 'hoh'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement