Write a program that takes an IP address block in CIDR notation and returns the list of all valid host IP addresses within that subnet.
Implement def cidr_hosts(cidr):, where cidr is a valid IPv4 CIDR string and the result is a list of IPv4 address strings in ascending order. Exclude network and broadcast addresses for subnets with at least four addresses. For /31, return both addresses, and for /32, return the single address. Assume prefixes range from /24 through /32.
cidr is a valid IPv4 CIDR string.def cidr_hosts(cidr):