Doppelganger

Report a typo

Wow! This problem is kind of tricky. If you're ready to put your thinking cap on, brace yourself and good luck! Otherwise, you can skip it for now and return any time later

Create a program that calculates how many objects in the list object_list have the same hash value as some other element in the list. You should print the number of those objects. If there are no matching hash values, the output should be 0.

For example, if object_list = [1, 397, 27468, -95, 1309, 397, -539874, -240767, -95, 397], the output should be 5.

Keep in mind that not every object in the list may be hashable!

Write a program in Python 3
# the object_list has already been defined
# write your code here
___

Create a free account to access the full topic