You are viewing a single comment's thread from:

RE: Learning to Think Algorithmically

in Programming & Dev2 years ago

The thing about Python (and Javascript) is that, for most things you are thinking to do it yourself... High chance someone had did something that you can import instead :) but solving it yourself is still good, though. So you'll know how it actually works and learn the idea behind IP addresses.

If you dig deeper, you might also find out that IP addresses are actually just 32-bit integers chopped into 4 sections in terms of bits. With this knowledge, you can do the conversion of IP addresses to integers without using multiplication or powers at all :) (probably not even using the '+' operation!) The rabbit hole only goes deeper from here, hehe.