Skip to content

Instantly share code, notes, and snippets.

@btipling
Created August 5, 2015 23:05
Show Gist options
  • Save btipling/4093da7c30e358488465 to your computer and use it in GitHub Desktop.
Save btipling/4093da7c30e358488465 to your computer and use it in GitHub Desktop.
def find_best(telephone_number):
results = filter(lambda x : telephone_number.find(x) is not -1, ("001","001631","001800"))
current = ""
for res in results:
if len(res) > len(current):
current = res
return current
print(find_best("0016316420665"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment