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