HS exam question
Convert the data to a python dictionary
Start file
e: 45.063 % s: 42.182 % a: 40.586 % r: 30.316 % o: 28.193 % i: 27.897 % l: 24.621 % n: 23.124 % t: 22.992 % d: 17.676 % u: 17.051 % c: 14.648 % y: 14.253 % h: 12.986 % p: 12.459 % m: 12.130 % b: 10.253 % g: 10.204 % k: 9.118 % w: 7.456 % f: 7.077 % v: 5.003 % z: 2.271 % x: 1.860 % j: 1.366 % q: 0.741 %
End file
letters = { "e": 0.45063, "s": 0.42182, "a": 0.40586, "r": 0.30316, "o": 0.28193, "i": 0.27897, "l": 0.24621, "n": 0.23124, "t": 0.22992, "d": 0.17676, "u": 0.17051, "c": 0.14648, "y": 0.14253, "h": 0.12986, "p": 0.12459, "m": 0.12130, "b": 0.10253, "g": 0.10204, "k": 0.09118, "w": 0.07456, "f": 0.07077, "v": 0.05003, "z": 0.02271, "x": 0.01860, "j": 0.01366, "q": 0.00741 }
View Diff
1,26c1,28 < e: 45.063 % < s: 42.182 % < a: 40.586 % < r: 30.316 % < o: 28.193 % < i: 27.897 % < l: 24.621 % < n: 23.124 % < t: 22.992 % < d: 17.676 % < u: 17.051 % < c: 14.648 % < y: 14.253 % < h: 12.986 % < p: 12.459 % < m: 12.130 % < b: 10.253 % < g: 10.204 % < k: 9.118 % < w: 7.456 % < f: 7.077 % < v: 5.003 % < z: 2.271 % < x: 1.860 % < j: 1.366 % < q: 0.741 % --- > letters = { > "e": 0.45063, > "s": 0.42182, > "a": 0.40586, > "r": 0.30316, > "o": 0.28193, > "i": 0.27897, > "l": 0.24621, > "n": 0.23124, > "t": 0.22992, > "d": 0.17676, > "u": 0.17051, > "c": 0.14648, > "y": 0.14253, > "h": 0.12986, > "p": 0.12459, > "m": 0.12130, > "b": 0.10253, > "g": 0.10204, > "k": 0.09118, > "w": 0.07456, > "f": 0.07077, > "v": 0.05003, > "z": 0.02271, > "x": 0.01860, > "j": 0.01366, > "q": 0.00741 > }
Solutions by @eric_briand:
Unlock 1 remaining solutions by signing in and submitting your own entry