Is there a universal way of iterating over a set or values of a dict in Python 2.7?
<p>I expect the collection to be either a set or a dict. Problem is that:</p>

<pre><code>for element in collection:
    print element
</code></pre>

<p>will give me the elements if collection is a set, but indexes if collection is a dict. What I want is a one-liner that will iterate over dict values.</p>

<p>Is that possible?</p>
