A good place to look at : <a href="http://www.norvig.com/sudoku.html">http://www.norvig.com/sudoku.html</a><br><br><div class="gmail_quote">On Mon, Apr 7, 2008 at 6:53 PM, Luke Paireepinart &lt;<a href="mailto:rabidpoobear@gmail.com">rabidpoobear@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">W W wrote:<br>
&gt; On 4/7/08, Luke Paireepinart &lt;<a href="mailto:rabidpoobear@gmail.com">rabidpoobear@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; W W wrote:<br>
&gt;&gt; &nbsp;What are you talking about? &nbsp;I don&#39;t understand what you mean by &quot;ignores<br>
&gt;&gt; whitespace between dictionary elements.&quot;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;&gt; foo = {&#39;1a&#39;: 1, &#39;1b&#39;:2, &#39;1c&#39;:3,<br>
&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#39;2a&#39;: 0, &#39;2b&#39;: 9, &#39;2c&#39;: 6}<br>
&gt;&gt;&gt;<br>
&gt;<br>
&gt; Exactly that. If you were to write:<br>
&gt;<br>
&gt; foo = {&#39;1a&#39;: 1, &#39;1b&#39;:2, &#39;1c&#39;:3}<br>
&gt; &nbsp; &nbsp; foo[&#39;2a&#39;] = 0<br>
&gt;<br>
&gt; You would get a nifty error.<br>
&gt;<br>
</div>You mean that the dictionary _definition_ ignores whitespace between<br>
elements?<br>
That&#39;s quite different than the dictionary itself ignoring whitespace.<br>
That implies that<br>
foo[&#39;1b&#39;] is the same element as foo[&#39;1 b&#39;], hence the source of &nbsp;my<br>
confusion.<br>
<br>
That&#39;s not a feature of dictionaries, but of the comma.<br>
You can easily do the following:<br>
x = [1, 2,<br>
 &nbsp; &nbsp; &nbsp; 3, 4]<br>
if you want.<br>
Same with tuples and various other things.<br>
Python just realizes that if it doesn&#39;t see a closing brace/bracket, but<br>
sees a comma, that more will probably be coming on the next line.<br>
You can do the same thing with backslash, if your statement does not end<br>
in a comma: for example,<br>
x = 1 + 1 + \<br>
 &nbsp; &nbsp; &nbsp;2 + 3 + 5 \<br>
 &nbsp; &nbsp; &nbsp;+ 8 + 13<br>
<br>
Also, did you test the code that &quot;generates an error?&quot;<br>
It works fine for me.<br>
&nbsp;&gt;&gt;&gt; foo = {&#39;1a&#39;: &#39;b&#39;}<br>
&nbsp;&gt;&gt;&gt; foo[&#39;2b&#39;] = 0<br>
&nbsp;&gt;&gt;&gt; print foo[&#39;2b&#39;]<br>
0<br>
&nbsp;&gt;&gt;&gt;<br>
<br>
Hope that helps,<br>
<font color="#888888">-Luke<br>
</font><div><div></div><div class="Wj3C7c">_______________________________________________<br>
Tutor maillist &nbsp;- &nbsp;<a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
</div></div></blockquote></div><br>