Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
""Finds all anagrams from a dictionary files for the letters provided
as argument"""
import sys
def is_anagram(letters, word):
letters_a = list(letters)
try:
[letters_a.remove(x) for x in word]
#!/usr/bin/env python
def flatten(d_list):
"""Flatten arbitrarily nested arrays of integers/strings.
Raises ValueError if the argument is not a list."""
if not isinstance(d_list, list):
raise ValueError("Argument must be a list type")
# Make a copy to preserve the original
d_list = list(d_list)
#!/usr/bin/env python
"""Opens 'coordinates.json' and prints out customers who are closer
than 100 KM ordered by the user_id.
Skips and prints records to STDERR which are not valid."""
import json
from operator import itemgetter
import sys
from math import sin, cos, radians, sqrt, pow, atan2

Keybase proof

I hereby claim:

  • I am tripy on github.
  • I am tripy (https://keybase.io/tripy) on keybase.
  • I have a public key ASD1ldrRdOEa6Kq_WyeHmEaFtAYnY7tky0Gg9BWZ2tWZWAo

To claim this, I am signing this object: