Error in grade assignment 1

In the first graded assignment there is a function:

def query_news(indices):
    """
    Retrieves elements from a dataset based on specified indices.

    Parameters:
    indices (list of int): A list containing the indices of the desired elements in the dataset.
    dataset (list or sequence): The dataset from which elements are to be retrieved. It should support indexing.

    Returns:
    list: A list of elements from the dataset corresponding to the indices provided in list_of_indices.
    """
     
    output = [NEWS_DATA[index] for index in indices]

    return output

But there is no dataset parameter

1 Like

instead of posting def statment, post screenshot of the error you have encountered.

There is no error I have encountered. The documentation of the function is wrong.

1 Like

argument Parameters: mentions dataset

but there is no dataset argument in the function signature

The dataset referenced in the function you provided is the variable named NEWS_DATA within the list comprehension: output = [NEWS_DATA[index] for index in indices]

but I agree the def statement could have been query_news(indices, NEWS_DATA)

Thank you @billyboe for informing this issue.

@lucas.coutinho can this be updated?

cc @lucas.coutinho