For both parts below, be careful to make sure that you don't change the values of the
Fantastic news! We've Found the answer you've been seeking!
Question:
For both parts below, be careful to make sure that you don't change the values of the original list being passed to the function:
- Write a function, has_duplicate(input_list), that accepts a list and returns True if the list has a duplicate item and False if it does not.
- Write a function, remove_duplicate(input_list), that accepts a list and returns the list, in order, keeping only the first instance of any duplicated values.
Then, write a function, invert_dict(input_dictionary), that accepts a dictionary whose keys and values are both of immutable types and returns a dictionary whose keys are the values of the input dictionary and whose values are ordered lists of keys that share that value.
Related Book For
Management Accounting Information for Decision-Making and Strategy Execution
ISBN: 978-0137024971
6th Edition
Authors: Anthony A. Atkinson, Robert S. Kaplan, Ella Mae Matsumura, S. Mark Young
Posted Date: