How do I print a sorted Dictionary in Python 3.4.3
<p>I am studying for my GCSE part of which requires me to print a dictionary sorted alphabetically by key and the print should include the associated value.</p>

<p>I have spent hours trying to find the answer to this and have looked at various posts on this forum but most are too complex for my limited knowledge.</p>

<p>I can print alphabeticallycsorted Keys and I can print sorted values but not alphabetically sorted keys with the values attached.</p>

<p>This is my simple test code</p>

<pre><code>class1 = { 'Ethan':'9','Ian':'3','Helen':'8','Holly':'6' } # create dictionary

print(sorted(class1)) # prints sorted Keys
print(sorted(class1.values())) # Prints sorted values
</code></pre>

<p>I need to print sorted keys with values - how to do that?</p>

<pre><code>for k,v in class1.items():
    print(k,v)  # prints out in the format I want but not alphabetically sorted
</code></pre>