Last active
August 29, 2015 14:07
-
-
Save mythmon/5cb60d31540db237bd5b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
{ | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ | |
"metadata": {}, | |
"cell_type": "code", | |
"input": "names = ('hamper Ac-town akeym Alan_S AmazonGirth andrewfree armoredPotato Author basic` benjipdx bkero blkperl borcean bramwelt '\n 'bryon chance chapmant chekkaa churchjo cmartin0 deanj doodles526 dot1q dubious edunham ekem EOBeav fridgei frostsnow '\n 'fyrexus goose1 Guest364 haroldhu1s irdan jenkitay Jennjitzu jesusaurus jnoah jordane leel8on lemurph lrr lucyw MaraJade '\n 'marineam Mathuin mburns MichaelC muricula murrown mythmon nibalizer Odysimus parkerf payneal_ PBJmonst1r pingveno pono '\n 'pop_n_fresh pwnguin Ramereth relud robatron rordway_ saline shirgan simpson smcgregor spectralsun steelee_ swansonb_ '\n 'teiresias terrellt tschuy tys0n vanrysss voidpris1 Wahrheit wenzel zounese zubriske')\n\nnames = (name.rstrip('_') for name in names.split(' '))\n\nfrom collections import defaultdict\ncults = defaultdict(lambda: [])\nfor name in names:\n cults[len(name)].append(name)\n\nfor length, names in sorted(cults.items()):\n print('Cult of {}: {} member{s}'.format(length, len(names), s=('s' if len(names) > 1 else '')))\n print(', '.join(names))\n print()", | |
"prompt_number": 16, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"text": "Cult of 3: 1 member\nlrr\n\nCult of 4: 2 members\nekem, pono\n\nCult of 5: 10 members\nakeym, bkero, bryon, deanj, dot1q, irdan, jnoah, lucyw, relud, tys0n\n\nCult of 6: 11 members\nhamper, Alan_S, Author, basic`, chance, EOBeav, goose1, mburns, saline, tschuy, wenzel\n\nCult of 7: 22 members\nAc-town, blkperl, borcean, chekkaa, dubious, edunham, fridgei, fyrexus, jordane, leel8on, lemurph, Mathuin, murrown, mythmon, parkerf, payneal, pwnguin, rordway, shirgan, simpson, steelee, zounese\n\nCult of 8: 20 members\nbenjipdx, bramwelt, chapmant, churchjo, cmartin0, Guest364, jenkitay, MaraJade, marineam, MichaelC, muricula, Odysimus, pingveno, Ramereth, robatron, swansonb, terrellt, vanrysss, Wahrheit, zubriske\n\nCult of 9: 6 members\nfrostsnow, Jennjitzu, nibalizer, smcgregor, teiresias, voidpris1\n\nCult of 10: 5 members\nandrewfree, doodles526, haroldhu1s, jesusaurus, PBJmonst1r\n\nCult of 11: 3 members\nAmazonGirth, pop_n_fresh, spectralsun\n\nCult of 13: 1 member\narmoredPotato\n\n", | |
"stream": "stdout" | |
} | |
], | |
"language": "python", | |
"trusted": true, | |
"collapsed": false | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "code", | |
"input": "", | |
"outputs": [], | |
"language": "python", | |
"trusted": true, | |
"collapsed": false | |
} | |
], | |
"metadata": {} | |
} | |
], | |
"metadata": { | |
"signature": "sha256:68f859f9d9f3b8a5204cabb7500d21fb2aea6167307c5145bf3752ddfdd5a937", | |
"name": "", | |
"gist_id": "5cb60d31540db237bd5b" | |
}, | |
"nbformat": 3 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment