def param_to_string(param):
    """
    Helper function for random_generator, creates a string from the param dict
    :param param_dict: param_dict from random_generator
    :return: string of params
    """
    string = "<p>Search results for these parameters: </p>"
    if param == {}:
        return "<p></p>"
    for key, value in param.items():
        if isinstance(value, dict):
            string += "<p>  " + key + ": " + "from " + str(value['from']) + " to " + str(value["to"]) + "</p>"
        else:
            if not isinstance(value, list):
                string += "<p>  " + key + ": " + " ".join(value) + "</p>"
            else:
                string += "<p>  " + key + ": " + str(value) + "</p>"
    return string