def convert_data(planet):
    """Convert string values of a dictionary to the appropriate type whenever possible.
    Remember to set the value to None when the string is "unknown".

    Type conversions:
        rotation_period (str->int)
        orbital_period (str->int)
        diameter (str->int)
        climate (str->list) e.g. ["hot", "humid"]
        gravity (str->dict) e.g. {"measure": 0.75, "unit"; "standard"}
        terrain (str->list) e.g. ["fungus", "forests"]
        surface_water (str->float)
        population (str->int)

    Parameters:
        dict: dictionary of a planet

    Returns:
        dict: dictionary of a planet with its values converted
    """

    for key, val in planet.items():
        if isinstance(val, str):
            if not val or val.lower() in ('n/a', 'none', 'unknown'):
                planet[key] = None
            else:
                if key in ('diameter', 'orbital_period', 'population', 'rotation_period'):
                    planet[key] = int(val)
                elif key in ('climate', 'terrain'):
                    planet[key] = val.strip().split(', ')
                elif key == 'surface_water':
                    planet[key] = float(val)
                elif key == 'gravity':
                    gravity = val.strip().split()
                    planet['gravity'] = {"measure": float(gravity[0]), "unit": "standard"}
                else:
                    continue

    return planet

    # if planet.get('rotation_period') == "unknown":
    #     planet['rotation_period'] = None
    # else:
    #     planet['rotation_period'] = int(planet['rotation_period'])

    # if planet.get('orbital_period') == "unknown":
    #     planet['orbital_period'] = None
    # else:
    #     planet['orbital_period'] = int(planet['orbital_period'])

    # if planet.get('diameter') == "unknown":
    #     planet['diameter'] = None
    # else:
    #     planet['diameter'] = int(planet['diameter'])

    # if planet.get('climate') == "unknown":
    #     planet['climate'] = None
    # else:
    #     planet['climate'] = planet['climate'].strip().split(', ')

    # if planet.get('gravity') == "unknown":
    #     planet['gravity'] = None
    # else:
    #     splitted = planet['gravity'].strip().split()
    #     if len(splitted) == 2:
    #         planet['gravity'] = {"measure": float(splitted[0]), "unit": splitted[1]}
    #     else:
    #         planet['gravity'] = {"measure": float(splitted[0]), "unit": "standard"}

    # if planet.get('terrain') == "unknown":
    #     planet['terrain'] = None
    # else:
    #     planet['terrain'] = planet['terrain'].strip().split(', ')

    # if planet.get('surface_water') == "unknown":
    #     planet['surface_water'] = None
    # else:
    #     planet['surface_water'] = float(planet['surface_water'])

    # if planet.get('population') == "unknown":
    #     planet['population'] = None
    # else:
    #     planet['population'] = int(planet['population'])

    # return planet