This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# In[76]: | |
from collections import defaultdict | |
merge_cities = { | |
'NYC': ['EWR', 'JFK', 'LGA'], | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python -u | |
# Use: modem-speed.py [baud, default 1200] | |
import sys | |
from time import sleep | |
baud = len(sys.argv) > 1 and int(sys.argv[1]) or 1200 | |
cps = baud/10.0 # 10 baud per octet at 8n1 | |
while True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from operator import mul, add, sub, truediv | |
from itertools import product, permutations | |
ops = [ | |
[ mul, "{a} x {b}" ], | |
[ add, "{a} + {b}" ], | |
[ sub, "{a} - {b}" ], | |
[ lambda a, b: sub(b, a), "{b} - {a}" ], | |
[ truediv, "{a} / {b}" ], | |
[ lambda a, b: truediv(b, a), "{b} / {a}" ], |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.