Skip to content

Instantly share code, notes, and snippets.

@Scriptor
Created October 22, 2015 00:21
Show Gist options
  • Save Scriptor/02bbd587c9dc4f6d5636 to your computer and use it in GitHub Desktop.
Save Scriptor/02bbd587c9dc4f6d5636 to your computer and use it in GitHub Desktop.
def foo(stuff):
return stuff
def bar(stuff):
return 3 * stuff
def f(func, stuff):
return 2 * func(stuff)
f(bar, 5) # =>
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