Python - regarding dictionaries, I currently have an empty (well, almost empty - with one dummy element) array of dictionary items, with a "name" and a freq

```
[{"name": "XYZ","freq": 1}]

```

I am running a process wherein : 
- I will obtain a new "name" value
- If this does not already exist in the dictionary, I append the same
- If this does exist, I increment the frequency by 1 (freq +=1)

The following is my code, at first I thought it worked well, then I realised that there does not seem to be any "incrementing" that occurs (freq is always one) - can someone help me understand what to change?

Thanks in advance !
Sundar

```
#Dummy array
CompName=[{"name":"","freq":0}]
for file in os.listdir(frame_loc):
#generate name from some process and add the same
    name={"name":CompNameText,"freq":1}
    gen=(CompNameText for name in CompName if CompNameText in name.values())
    if CompNameText in gen:
        name["freq"]=name["freq"]+1
    else:
 #I feel it always executes only the else part of the condition, not the if
        CompName.append({"name":CompNameText,"freq":1})

```