I have a dictonary with key value pair where I want to set threshold as less than 50% for value which basically means in any of the key value pair where value pair has value less than 50% of all values we should put that key value pair in a dictonary and afterwards we have read those pair in a dictonary and check which key values are affecting the threshold.
{('a','b'):2,('b','c'):4,('c','d'):6,('d','e'):8,('e','f'):8,('f','g'):3,('g','h'):2,('h','i'):7,(i,j):10}
As you can see in above dictonary pair (a,b)
and (b,c)
have value 2 and 4 which is less than 50% so here we can say because b is common in both thats why value is less than 50%.So I want to print b as output.Same in case of (f,g)
and (g,h)
pair so here also output will be g.
So the final output which I want is-- b,g
Kindly help I am new to Python...