Unable to understand results of Python code
<p>I was learning about dictionaries in Python and I created a simple program:</p>

<pre><code># Create an empty dictionary called d1
d1 = {}

# Print dictionary and length
def dixnary():
    print "Dictionary contents : "
    print d1
    print "Length = ", len(d1)

# Add items to dictionary
d1["to"] = "two"
d1["for"] = "four"

print "Dictionary contents :"
print d1
print "Length =" , len(d1)

# Print dictionary and length
print dixnary()
</code></pre>

<p>Now there's a difference in the results when I use the <code>print</code> commands and when I use the <code>dixnary</code> function.</p>

<p>Using the <code>print</code> commands I get the result:</p>

<blockquote>
  <p>Dictionary contents:<br>
  &lt;'to':'two','for:'four'><br>
  Length = 2  </p>
</blockquote>

<p>and when I use the function <code>dixnary</code>, I get the results:</p>

<blockquote>
  <p>Dictionary contents:<br>
  &lt;'to':'two','for:'four'><br>
  Length = 2<br>
  None</p>
</blockquote>

<p>Notice the <code>None</code> on the final line. This <code>None</code> gets added when I use the function <code>dixnary</code>. Why is this?</p>
