Sort dict keys into list
<p>I have a dictionary containing IP addresses and hd space for each IP. </p>

<p>{'192.168.100.102': '7.3G', '192.168.100.103': '3.5G', '192.168.100.101': '7.4G', '192.168.100.107': '17G'} </p>

<p>I want to take three IPs with the greatest space and put them into a list. Is this possible?</p>

<p>This should work:</p>

<pre><code>ips = {'192.168.100.102': '7.3G', '192.168.100.103': '3.5G', '192.168.100.101': '7.4G', '192.168.100.107': '17G'}
sorted(ips, key=ips.get)[:3]
</code></pre>

<p>Actually this doesn't work because of the G in each value, use @Moses Koledoye's answer below. </p>

python dictionary