How to group the same values into same key?
How to group the same values into same key? Question: I have an assignment to do this things without import any helpful function, could you guys help me? Thanks! data = [ [‘num’,’e1′,’e2′,’e3′], [‘2002′,’p’,’r’,’i’], [‘2002′,’k’,’r’,’i’], [‘2001′,’k’,’r’,’e’], [‘2004′,’p’,’a’,’p’], [‘2004′,’p’,’s’,’f’] ] newlist = [ {‘num’: ‘2001’, ‘e1’: ‘k’, ‘e2’: ‘r’, ‘e3’: ‘e’}, {‘num’: ‘2002’, ‘e1’: ‘p’, ‘e2’: …