ip calculator on python with basic functionality