A place to start, without coding the solution for you. Post your code for help with further problems.

main_list = [['a', 'b', 'c', 'd'], ['e', 'f'], ['g', 'h']]
for each_list in main_list:
print "\n New List"
for ctr in range(len(each_list)):
print ctr, each_list[ctr]

Find the mathematical base for what you want to do and find what is this function named mystery here in standard library (the import of module left out here):

from ____ import ____ as mystery
x=[['a', 'b', 'c', 'd'], ['e', 'f'], ['g', 'h']]
for sub in x:
print list(mystery(sub,2))
print '\n'.join('-'.join(solution) _____)
'''Output:
[('a', 'b'), ('a', 'c'), ('a', 'd'), ('b', 'c'), ('b', 'd'), ('c', 'd')]
[('e', 'f')]
[('g', 'h')]
a-b
a-c
a-d
b-c
b-d
c-d
e-f
g-h
'''