We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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:
report = sorted(directors.items(), key=lambda x: float(x[0][1]), reverse=True)
{ (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}, }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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:
Is it good practice to have a tuple as a key for dictionaries?
It seems that those formats would be more readable and useful:
The text was updated successfully, but these errors were encountered: