I am using Python 3.5. I have a dictionary with entries:
myresult = { '6.1.2 & 6.3.2, abcd' : xyz,
'6.10.2 & 6.12.2, hjsd' : xyz, abc, ssd
'6.2.2 & 6.4.2, abcd' : asd,
'6.9.2 & 6.11.2, qwer' : tzu,
'6.21.2 & 6.23.2, xzty' : asd }
Expected output is
>>>'6.1.2 & 6.3.2, abcd' : xyz
'6.2.2 & 6.4.2, abcd' : asd
'6.9.2 & 6.11.2, qwer' : tzu,
'6.10.2 & 6.12.2, hjsd' : xyz, abc, ssd
'6.21.2 & 6.23.2, xzty' : asds
i.e., I need the numbers to be sorted after the decimal point as normal integers.
I tried using for key in sorted(myresult.keys()): print(key)
The output was
'6.1.2 & 6.3.2, abcd' : xyz
'6.10.2 & 6.12.2, hjsd' : xyz, abc, ssd
'6.2.2 & 6.4.2, abcd' : asd
'6.21.2 & 6.23.2, xzty' : asds
'6.9.2 & 6.11.2, qwer' : tzu
Any Help would be very much appreciated.
Thank you