[Tutor] dynamical program to create subnets CIDR
Alan Gauld
alan.gauld at btinternet.com
Mon Oct 7 14:54:21 EDT 2019
On 07/10/2019 19:31, ose micah wrote:
> Can anyone help with a program that could compare a list of IPs and
> create the least possible CIDR block sets from these IPs.
>
> for example.
>
> I have a list say:
>
...
>
> I want to reduce this list to:
>
> 10.32.0.0/14
> 202.238.149.0/19
> 10.224.0.0/13
> 10.54.63.0/13
Sorry but I cannot see how you get to the second list
from the first. I think you need to give us a clue what
the high level algorithm is. Don't assume we know your
problem domain. Most of us don't, we know Python.
At a basic level I'd suggest investigating functions
like str.split(), sort(), max/min(). But even that
does not appear sufficient to meet your needs.
Without understanding the criteria I can't guess the algorithm.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
More information about the Tutor
mailing list