I have a dict 

```
my_dict =
    { '123@com' : [ { 'event': 'event1', 'oldval' = 1, 'newval = 2}, { 'event': 'event2', 'oldval' = 11, 'newval': 22}, { 'event': 'event3', 'oldval' = 33, 'newval': 44}] 
    {'1234@com' : { 'event1': 'oldval': 45, 'newval': 66},
    {'12345@com': [ {'event':'event2', 'oldval': 77, 'newval': 99}, { 'event': 'event3', 'oldval': '99', 'newval': 100'}]

```

So basically my goal is to build a list 

```
 [ ['123@com', (2,1,True), (22,11, True), (44,33,True)], ['1234@com', (66,45,True), ('','',False),('','',False)], ['12345@com', ('',''False), (99,77,True), (100,99)]]

```

So my goal is to capture the value if event is changed and get the values and marked as true.

So the code which I am writing is as follows: 

```
for key,value in my_dict.items():
  if str(my_dict).find('event1') >- 1 or str(my_dict).find('even2') > 1 or str(my_dict).find('event3') > -1: 
  tmp_list = []
  tmp_list.append(key)
  if type(value) is dict:
    if value['event'] == 'event1': 
       @ get all the value and append to tmp_list
    if value['event'] == 'event2':
      @ do the same thing as above
  else:
     for val in value:
      if val['name'] == 'event':
        @ do the same stuff. 
      @do the same stuff again for rest of event. 

```

So basically I am able to achieve my goal by following the above code pattern. 

So any one can help me out in coding better,I will really appreciate it.
I don't like the way I am coding. 

Thanks