def isValidIPAddress(addr):
    """Returns True if the IP address is valid and False if not."""
    pieces = addr.split('.')
    if len(pieces) != 4:
        return False
    for piece in pieces:
        try:
            num = int(piece)
        except ValueError:
            return False
        if not (num >= 0 and num <= 255):
            return False
    return True
