Created
February 6, 2021 16:20
-
-
Save emaballarin/ac2035ac4b77ca88749eeaf04766c446 to your computer and use it in GitHub Desktop.
One-liner solution to https://github.com/asartori86/advanced_programming_2020/blob/master/exam/python_exam.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def reverse_dict(d): | |
return {lhs: [_ for _ in d.keys() if (lhs in d.get(_))] for lhs in set().union(*(d.values()))} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment