Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def remove_keys(keys_to_remove: list, dictionary: dict) -> dict:
- """
- Filter out every dictionary element if its key is in given list.
- :param keys_to_remove: List of keys to remove
- :param dictionary: dict
- :return: Dict without given keys
- """
- def remove_from_values(values_to_remove: list, dictionary: dict) -> dict:
- """
- Filter out every dictionary element if its value is in given list.
- :param values_to_remove: List of values to remove
- :param dictionary: dict
- :return: Dict without given values
- """
- pass
- def sort_keys_by_alphabet(dictionary: dict) -> list:
- """
- Sort dictionary keys in descending alphabetical order.
- {"doggo": 5, "pupper": 6} == ["pupper", "doggo"]
- :param dictionary: dict
- :return: List of keys which are sorted in descending alphabetical order
- """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement