Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:24:06) [MSC v.1600 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> ord("A") 65 >>> int(ord("A"), 16) Traceback (most recent call last): File "", line 1, in int(ord("A"), 16) TypeError: int() can't convert non-string with explicit base >>> int("65", 16) 101 >>> int("01110", 2) 14 >>> int("a", 16) 10 >>> hex(65) '0x41' >>> oct(65) '0o101' >>> bin(65) '0b1000001' >>> hex(ord("A")) '0x41' Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:24:06) [MSC v.1600 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> ================================ RESTART ================================ >>> >>> char_count(tom) [('e', 38085), ('t', 30895), ('o', 24942), ('a', 24871), ('n', 21508), ('h', 20359), ('i', 20281), ('s', 18829), ('r', 16749), ('d', 15566), ('l', 12780), ('u', 9624), ('w', 8390), ('m', 7686), ('c', 7298), ('y', 7139), ('g', 7108), ('f', 6499), ('b', 5293), ('p', 5275), ('k', 3207), ('v', 2551), ('j', 751), ('x', 439), ('q', 191), ('z', 161)] >>> len(tom) 421872 >>> stats(tom) [('e', 12.03), ('t', 9.76), ('o', 7.88), ('a', 7.85), ('n', 6.79), ('h', 6.43), ('i', 6.4), ('s', 5.94), ('r', 5.29), ('d', 4.91), ('l', 4.03), ('u', 3.04), ('w', 2.65), ('m', 2.42), ('c', 2.3), ('y', 2.25), ('g', 2.24), ('f', 2.05), ('b', 1.67), ('p', 1.66), ('k', 1.01), ('v', 0.8), ('j', 0.23), ('x', 0.13), ('q', 0.06), ('z', 0.05)] >>> stats("abc") [('b', 33.33), ('c', 33.33), ('a', 33.33)] >>> len(stats(tom)) 26 >>> stats(romeo) [('e', 12.06), ('t', 9.32), ('o', 8.38), ('a', 7.7), ('i', 6.58), ('s', 6.18), ('h', 6.18), ('r', 6.17), ('n', 6.11), ('l', 4.63), ('d', 3.69), ('u', 3.48), ('m', 3.13), ('y', 2.49), ('w', 2.3), ('c', 2.2), ('f', 1.93), ('g', 1.78), ('b', 1.62), ('p', 1.58), ('v', 1.03), ('k', 0.77), ('j', 0.28), ('x', 0.19), ('q', 0.06), ('z', 0.03)] >>> len(stats(romeo)) 26 >>> stats(nyt) [('t', 9.24), ('e', 9.19), ('a', 8.41), ('i', 7.95), ('s', 7.74), ('o', 6.48), ('n', 6.3), ('l', 5.89), ('r', 5.47), ('c', 5.0), ('d', 4.12), ('h', 4.11), ('m', 3.68), ('p', 2.93), ('y', 2.19), ('u', 2.08), ('w', 1.92), ('g', 1.8), ('f', 1.36), ('v', 1.29), ('b', 1.27), ('k', 0.67), ('x', 0.39), ('j', 0.18), ('q', 0.12), ('z', 0.09)] >>> len(_) 26 >>> Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:24:06) [MSC v.1600 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> ================================ RESTART ================================ >>> >>> arithmetize("abc") 416618250339 >>> arithmetize("abcdfsdk.fjgsdh") 2615155142196709079680220799238463443946593208547275439653626237419624 >>> arithmetize_text("abc", 2) [6357090, 6422627] >>> arithmetize("ab") 6357090 >>> arithmetize("bc") 6422627 >>> arithmetize_text("abcdefg", 2) [6357090, 6422627, 6488164, 6553701, 6619238, 6684775] >>> arithmetize_text("abcdefg", 6) [117267612311404705680261222, 118476556578044887836262503] >>>