Created
October 22, 2015 00:21
-
-
Save Scriptor/02bbd587c9dc4f6d5636 to your computer and use it in GitHub Desktop.
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
def foo(stuff): | |
return stuff | |
def bar(stuff): | |
return 3 * stuff | |
def f(func, stuff): | |
return 2 * func(stuff) | |
f(bar, 5) # => |
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
nums = [1,2,3,4,5] | |
nums.sort() | |
def div_yield(ticker): | |
# Magic shit here | |
return div_yield_for_ticker | |
tickers = ["foo", "bar", "aapl", "msft", "goog", "baz"] | |
alphabet_sorted_tickers = tickers.sorted() | |
div_yield_tickers = tickers.sorted(key=div_yield) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment