Question: Python program I have a nested dictionary { 1: [2, 4, 1, 3], 2: [1, 3, 2, 4], 3: [4, 3, 1, 2], 4: [1,

Python program

I have a nested dictionary { 1: [2, 4, 1, 3], 2: [1, 3, 2, 4], 3: [4, 3, 1, 2], 4: [1, 3, 4, 2], 5: [2, 3, 4, 1], 6: [3, 1, 2, 4] }

What i want is to assign values to each item in my list. So i need a function that assigns value of 1 to every first item in the list, I/2 to the 2nd position. 1/3 to the 3rd position. 1/4 on to the 4th position.

So for example my list 1 becomes [(2,1) (4,1/2) (1,1/3) (3,1/4)], Then when i want to tally each number value going over all of my 6 list in my dictionary. The number with the highest value wins

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!