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
""" | |
schieber.py | |
----------- | |
Python implementation of the distance method in 'Quantification of network | |
structural dissimilarities', by Schieber et al. | |
""" | |
import numpy as np |
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
""" | |
dfs.py | |
------ | |
https://www.hackerrank.com/challenges/connected-cell-in-a-grid | |
09/22/16 | |
""" | |
def get_neighbors(i, j): |
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
""" | |
https://github.com/reeddunkle/Codjo/tree/master/Problem3_Rangoli | |
""" | |
from string import ascii_lowercase | |
from itertools import chain | |
def reflect(iterable): | |
return chain(reversed(iterable), iterable[1:]) |
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
# Merged your top-level comment into the docstring. | |
""" Exercise 8, Chapter 10 | |
This exercise pertains to the so-called Birthday Paradox, which you can read | |
about at http://en.wikipedia.org/wiki/Birthday_paradox. | |
If there are 23 students in your class, what are the chances that two of you | |
have the same birthday? You can estimate this probability by generating random | |
samples of 23 birthdays and checking for matches. Hint: you can generate random | |
birthdays with the randint function in the random module. |
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
""" | |
Earlier today, in the Recurse Center Slack Room, one of my mentors jokingly suggested | |
a project idea for a "cool metal band generator." I thought that was a fun idea, | |
so I made one. Whether the names generated are cool or not is up for debate. | |
Some examples: | |
* asses vile | |
* enfeeble revocation | |
* dominie dying fetus | |
* overexercise nile |
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 itertools import product | |
print(next(p for p in reversed(sorted(i*j for i,j in product(range(100,999),range(100,999)))) if list(str(p))==list(reversed(str(p))))) |
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
# properties.py | |
# test python properties! | |
import math | |
class LittleThing(): | |
def __init__(self, state): |