Skip to content

Instantly share code, notes, and snippets.

Last active Nov 17, 2021
What would you like to do?
import urllib,sys,csv;
print reduce(lambda p, new: (p[0] + (new - p[0])/p[1], p[1] + 1), map(float, (x['tip_amount'] for x in csv.DictReader(urllib.urlopen(sys.argv[1])))), (0, 1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment