Skip to content

Instantly share code, notes, and snippets.

@raeq
Created July 18, 2020 10:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raeq/19bd2a8fdb28dcf671dd80926ea9d64b to your computer and use it in GitHub Desktop.
Save raeq/19bd2a8fdb28dcf671dd80926ea9d64b to your computer and use it in GitHub Desktop.
Find a needle in a haystack
def sub_00(haystack: str="", needle:str="") -> bool:
return needle in haystack
assert sub_00("the quick brown fox jumped over the lazy dog", "lazy") == True
assert sub_00("the quick brown fox jumped over the lazy dog", "lazys") == False
@itbj
Copy link

itbj commented Jul 25, 2020

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment