Popular recipes tagged "unpack" but not "distributed"http://code.activestate.com/recipes/tags/unpack-distributed/2017-01-17T20:05:10-08:00ActiveState Code RecipesClassifying letters as vowels or consonants and counting their frequencies (Python) 2017-01-17T20:05:10-08:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580749-classifying-letters-as-vowels-or-consonants-and-co/ <p style="color: grey"> Python recipe 580749 by <a href="/recipes/users/4173351/">Vasudev Ram</a> (<a href="/recipes/tags/assertions/">assertions</a>, <a href="/recipes/tags/comprehension/">comprehension</a>, <a href="/recipes/tags/dict/">dict</a>, <a href="/recipes/tags/dictionaries/">dictionaries</a>, <a href="/recipes/tags/dict_comp/">dict_comp</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/python2/">python2</a>, <a href="/recipes/tags/tuple/">tuple</a>, <a href="/recipes/tags/unpack/">unpack</a>). </p> <p>This recipe shows how to take a string as input and classify the characters in it as vowels, consonants or neither. The frequency of each vowel is calculated and the frequency of all the consonants in total is calculated. The program logic is fairly simple, and uses a dictionary comprehension and a dict; the more interesting thing about it, is that it illustrates 8 Python language features in under 35 lines of code.</p> <p>More details and sample output here:</p> <p><a href="https://jugad2.blogspot.in/2017/01/classifying-letters-and-counting-their.html" rel="nofollow">https://jugad2.blogspot.in/2017/01/classifying-letters-and-counting-their.html</a></p> Converting arbitrary size Python integers to packed binary data strings (Python) 2009-01-16T13:27:29-08:00David Mosshttp://code.activestate.com/recipes/users/4124829/http://code.activestate.com/recipes/576617-converting-arbitrary-size-python-integers-to-packe/ <p style="color: grey"> Python recipe 576617 by <a href="/recipes/users/4124829/">David Moss</a> (<a href="/recipes/tags/binary/">binary</a>, <a href="/recipes/tags/integers/">integers</a>, <a href="/recipes/tags/pack/">pack</a>, <a href="/recipes/tags/struct/">struct</a>, <a href="/recipes/tags/unpack/">unpack</a>, <a href="/recipes/tags/unsigned/">unsigned</a>). </p> <p>Routines for converting <strong>large</strong> unsigned arbitrary sized Python integers to packed binary data strings and vice versa.</p>