input: Write a python function to check if a given string is a valid IP address.
  assert is_valid_ip("192.168.1.1") == True
  assert is_valid_ip("255.255.255.255") == True
  assert is_valid_ip("256.256.256.256") == False
  assert is_valid_ip("123.045.067.089") == False
output: def is_valid_ip(ip):
      parts = ip.split('.')
      if len(parts) != 4:
          return False
      for part in parts:
          if not part.isdigit():
              return False
          if not 0 <= int(part) <= 255:
              return False
          if part != str(int(part)):  # to check leading zeros
              return False
      return True