I am new to Python and want to create a dictionary for my csv file. My data has a format like:

```
c1     c2     p    trade
GER   USA     1     100
GER   ITA     1     80
JPN   ITA     2     120
USA   GBR     1     70
DNK   CAN     2     100
USA   DNK     2     70
DNK   GER     1     40
FRA   GER     4     50
USA   GER     6     80

```

I intend to create a dictionary that its keys be countries (c1 and c2) and the values be products(p). Something like this:

```
dic_c1c2_products={"GER": 1, 4,6 "USA":1,2,6 "ITA": 1,2, "JPN": 2 "GBR":1, DNK:"2,1 "CAN":2 "FRA:4} 

```

I have written the following code but it does not work properly:

```
rfile = open('filepath','r')
dic_c1c2_products = {}
for i in rfile :
    lns = i.strip().split(',')
    c1 = lns[0]
    c2 = lns[1]
    p = lns[2]
    if not dic_c1c2_products.has_key(c1) and not dic_c1c2_products.has_key(c2):
         dic_c1c2_products[c1] = [p,]
         dic_c1c2_products[c2]=[p,]
    elif dic_c1c2_products.has_key(c1) and not dic_c1c2_products.has_key(c2):
         dic_c1c2_products[c2]=[p,]
         if p not in dic_c1c2_products[c1]:
              dic_c1c2_products[c1].append(p)
   elif not dic_c1c2_products.has_key(c1) and dic_c1c2_products.has_key(c2):
         dic_c1c2_products[c1] = [p,]
         if p not in dic_c1c2_products[c2]:
             dic_c1c2_products[c2].append(p)
    elif dic_c1c2_products.has_key(c1) and dic_c1c2_products.has_key(c2):
         if p not in dic_c1c2_products[c2] and dic_c1c2_products[c1]:
             dic_c1c2_products[c1].append(p)
             dic_c1c2_products[c2].append(p)

```

Any help would be appreciated.