Sat, 12 Dec 2015 04:04:10 +0200
Added cdf (aka Φ(x)) to the calculator, removed unneeded list comprehensions
#!/usr/bin/env python3 # encoding: utf-8 ''' Provides the munge function. ''' import string mungechars = 'аɓᴄđеƒɡɦіјķɭṁɳорqŗѕƫᴜᴠᴡхуᴢАВСḌЕḞǴНІЈКLМΝОРQɌЅТÙⅤⱲХΥΖ' mungedict = dict (zip (string.ascii_lowercase + string.ascii_uppercase, mungechars)) def mungeone (ch): ''' Munges one character. ''' try: return mungedict[ch] except: return ch def munge (a): ''' Munges the given string ''' return ''.join (mungeone(ch) for ch in a)