0
How to sort out the list containing ip addresses?
I have a list a=[192.168.3.4, 23.45.5.67, 192.168.4.6,10.1.1.1]. I should sort this list in the ascending order so that 10.1.1.1 come first and 192.168.4.6 comes at the end of the list. how to achieve that? list.sort() method won't work here.
5 Antworten
+ 7
There you go:
https://code.sololearn.com/cJqu6Q00Gidt/?ref=app
+ 6
BTW, I have fine-tuned the sorting in this code, as I found some flaws in it.
+ 2
Try by yourself: I kindely answered your previous question... you must study, search by yourself on ressources available on internet in references, forums and tutorials, and then ask here for more specific question, posting your code attempt and being as accurate as you can by describing your problem ^^
0
hey visph. I have this task as part of my large assignment. I dunno if u knew this. sorting a simple list will work out easy. but sorting a list with IP addresses is very advanced. I have to retrieve only a particular column of destination IP addresses from a wireshark capture file and then I have to sort it and save it as a text file. I have achieved everything above except the sorting part. I have searched in Internet but very few sites have discussed about this. and I didn't understand in those sites. I am not supposed to use any other external modules other than inbuilt. so it is a challenging
- 1
adding to the above I am just using Python as a tool to solve some of my network problems