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
import functools | |
def variance(numbers): | |
mean = functools.reduce(lambda a,b : a+b, numbers) / len(numbers) | |
mapped_nums = map(lambda x : (x - mean)**2, numbers) | |
return functools.reduce(lambda a,b : a+b, mapped_nums) / len(numbers) |
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
### Keybase proof | |
I hereby claim: | |
* I am nickwohnhas on github. | |
* I am nick_wohnhas (https://keybase.io/nick_wohnhas) on keybase. | |
* I have a public key ASBtHCGVOGlbsq6iFspnLFQq-8xkBy2W_MSL-cz1e40I7Qo | |
To claim this, I am signing this object: |
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
cities = ['Tokyo', 'London', 'Rome', 'Donlon', 'Kyoto', 'Paris', 'Kyoot'] | |
empty_hash = {} | |
cities.each do |word| | |
empty_hash[word] = [] | |
altered = cities.dup | |
altered.delete(word) | |
altered.each do |city| | |
if city.downcase.split("").sort == word.downcase.split("").sort |