#Tisbury Treasure Hunt (Python) Task 5.

6 messages · Page 1 of 1 (latest)

worthy sable
#

Hi, i stuck with this task

My code:

    """Clean up a combined record group into a multi-line string of single records.

    :param combined_record_group: tuple - everything from both participants.
    :return: str - everything "cleaned", excess coordinates and information are removed.

    The return statement should be a multi-lined string with items separated by newlines.

    (see HINTS.md for an example).
    """
    clean_items=tuple()
    for item in combined_record_group:
        clean_items=item[0], item[2], item[3], item[4]
        return f"{clean_items}"

Error message:

TEST FAILURE
AssertionError: "('Sc[56 chars]lue')" != "('Sc[56 chars]lue')\n('Brass Spyglass', 'Abandoned Lighthous[810 chars]')\n"
Diff is 979 characters long. Set self.maxDiff to None to see it.

For me it seems i got the same result what is required in the task but it doesn't works.

ornate trail
#

I struggled to solve this exercise last week as well.

#

I interpret the error message as: your output is

('Sc[56 chars]lue')

On the other hand, the expected output is

('Sc[56 chars]lue')\n('Brass Spyglass', 'Abandoned Lighthous[810 chars]')\n
#

So, I think only the first element of the list is being output.

jade spoke
#

Yeah. You're not actually getting passed the first item because you return immediately

worthy sable
#

Thank you for the help! I solved it!