Question: Return a dictionary with two key-value pairs: 1. The key 'list_length' stores the length of the_list as its value. 2. The key 'unique_items' stores the

Return a dictionary with two key-value pairs:

1. The key 'list_length' stores the length of the_list as its value.

2. The key 'unique_items' stores the number of unique items in the_list as its value.

Arguments

the_list: A list

Examples

l = [1, 2, 2, 4]

dictionary = list_uniqueness(l)

print(dictionary['list_length']) # prints 4

print(dictionary['unique_items']) # prints 3

'''

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!