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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started