Question: I have a table named 'country' with a column named 'name'
and the names in this column appears with translation followed by special character '/'.

```
IRELAND/IRLANDE
GREECE/GRÈCE
DENMARK/DANEMARK

```

Now i want only the countrynames before this special character'/' so the out put should look like this.. 

```
IRELAND
GREECE
DENMARK

```

please help. Thanks in advance

Answer: 
Printing all single result and then combinations of `two keys` using `combinations`.

```
from itertools import combinations

for key in mydict:
    print "{}: '{}'".format(key, mydict[key])

for x, y in combinations(mydict, 2):
    print "{}: '{}'".format(x+y, '-'.join((mydict[x], mydict[y])))

```

**UPDATED**

Print all possible combinations.

```
from itertools import combinations

for n in range(len(mydict)):
    for combs in combinations(sorted(mydict), n+1):
        print "{}: '{}'".format(sum(combs), '-'.join([mydict[key] for key in combs]))

```
We don't know what you are actually looking for, but if it it is the powerset you are looking for:

```
from copy import deepcopy
def powerset (id_base=0, prefix="", dictionary=dict(), length=0):
    if length < 0:
        return dict()
    if length == 0:
        return dict((id_base,prefix))
    if len(prefix):
        prefix = prefix + "-"
    this_powerset = dict()
    for key, item in dictionary.items():
        smaller_dictionary = deepcopy(dictionary)
        del smaller_dictionary[key]
        this_powerset = dict(
            powerset( id_base + key,
                      prefix + item,
                      smaller_dictionary,
                      length - 1 ).items()
            + this_powerset.items()
    return this_powerset

```

run as

```
the_set = powerset(dictionary = mydict, length = len(mydict))

```

(Comes with all the exectution time problems of recursive functions)