input: Write a python function to check if a given IP address is valid. The function should return True for a valid IP address and False otherwise.
  assert is_valid_ip('192.168.0.1') == True
  assert is_valid_ip('256.256.256.256') == False
  assert is_valid_ip('123.45.67.89') == True
  assert is_valid_ip('123.456.78.90') == 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
          num = int(part)
          if num < 0 or num > 255:
              return False
      return True