Skip to content

Instantly share code, notes, and snippets.

@seanhuggins1
Created November 25, 2020 01:54
Show Gist options
  • Select an option

  • Save seanhuggins1/954b1d6cfd480f39e2b4c56f52c502bc to your computer and use it in GitHub Desktop.

Select an option

Save seanhuggins1/954b1d6cfd480f39e2b4c56f52c502bc to your computer and use it in GitHub Desktop.
def matchString(string, pattern):
i = 0
while i < len(string):
k = 0
while k < len(pattern):
if (string[i + k] == pattern[k]):
k += 1
continue
break
if (k == len(pattern)):
return i
else:
i += k + 1
return False
print(matchString("Hellpllo", "llo"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment