CIDR Utility
Phase 1 - CIDR to IP range conversion
Create a Python script that receives a CIDR subnet and outputs the corresponding IP range in a human-readable format.
- Input a CIDR subnet (e.g., 172.16.0.0/12)
- Calculate the first and last IP addresses in the range
- Display the range in readable format
Functional result: Script outputs correct start and end IP addresses for any valid CIDR subnet.
Phase 2 - IP membership verification
Extend the script to optionally check if a specific IP belongs to the given CIDR range.
- Accept an IP address as a second argument
- Verify whether the IP is within the subnet range
- Output True or False accordingly
Functional result: Script correctly indicates whether a given IP belongs to the specified CIDR range.