def check_address(ip_address):
if ip_address.count('.') != 3 or not all(ip_byte.isdigit() and int(ip_byte) < 255 for ip_byte in ip_address.split('.')):
return False
return True
def validate_ip_address(address):
parts = address.split(".")
if len(parts) != 4:
print("IP address {} is not valid".format(address))
return False
for part in parts:
if not isinstance(int(part), int):
print("IP address {} is not valid".format(address))
return False
if int(part) < 0 or int(part) > 255:
print("IP address {} is not valid".format(address))
return False
print("IP address {} is valid".format(address))
return True