re Challenge: More Compact?

Alex new_name at mit.edu
Sun Jul 15 15:51:53 EDT 2001


def ip_p(ip_string):

    try: bytes = map(int, ip_string.split('.'))
    except ValueError: return None
    return 0 <= min(bytes) <= max(bytes) < 256

HTH.
Alex.




More information about the Python-list mailing list