-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Description
The provided test is quite challenging due to the fact that it expects to use a dict with a tuple as a key.
https://github.com/pybites/challenges/blob/master/13/test_directors.py#L24
report = sorted(directors.items(), key=lambda x: float(x[0][1]), reverse=True)
To pass this test the dict has to be in this format:
{
(director, avg_score): movies,
}
Is it good practice to have a tuple as a key for dictionaries?
It seems that those formats would be more readable and useful:
{
director: (avg_score, movies),
}
{
director: {'avg_score': avg_score, 'movies': movies},
}
Metadata
Metadata
Assignees
Labels
No labels