creating a dictionary that maps ascii characters using map and range
<p>I am having some problems with mapping characters to a dictionary.  What I am going for is</p>

<pre><code>counter = { '!': 0, '"': 0, '#': 0, '$': 0 } ...
</code></pre>

<p>For all the ascii chars in the decimal ranges</p>

<pre><code>range(33,64) range(91,96) and range(123,126)
</code></pre>

<p>After some time I discovered that map could possibly be used passing chr as the function and the list returned from range for iterations...</p>

<pre><code>symbolMap = map(chr, range(33,64) + range (91,96) + range(123,126))
</code></pre>

<p>The problem is that this map does not corrospond to an ascii table, and it gets worse when I try </p>

<pre><code>counter = dict.fromkeys( symbolMap, 0 )
</code></pre>

<p>see my shell session:</p>

<pre><code>&gt;&gt;&gt; counter
{'!': 0, '#': 0, '"': 0, '%': 0, '$': 0, "'": 0, '&amp;': 0, ')': 0, '(': 0, '+': 0, '*': 0, '-': 0, ',': 0, '/': 0, '.': 0, '1': 0, '0': 0, '3': 0, '2': 0, '5': 0, '4': 0, '7': 0, '6': 0, '9': 0, '8': 0, ';': 0, ':': 0, '=': 0, '&lt;': 0, '?': 0, '&gt;': 0, '[': 0, ']': 0, '\\': 0, '_': 0, '^': 0, '{': 0, '}': 0, '|': 0}
&gt;&gt;&gt; chr(34)
'"'
&gt;&gt;&gt; range(33,64)
[33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63]
&gt;&gt;&gt; symbolMap
['!', '"', '#', '$', '%', '&amp;', "'", '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '&lt;', '=', '&gt;', '?', '[', '\\', ']', '^', '_', '{', '|', '}']
</code></pre>

<p>Can someone explain to me how to fix this so that it maps out correctly.</p>
