While I don't recommend this approach as a general rule, for purposes of learning here is a way to achieve what you want:
def getCombos(lts):
rslt = []
for l1 in lts:
for l2 in lts:
for l3 in lts:
for l4 in lts:
s = l1+l2+l3+l4
rslt.append(s)
return rslt
letters = 'abcdefghijklmnopqrstuvwxyz'
getCombos(letters)
As is illustrated by a simple example, this code is of O(n^x) in complexity where n = number of characters and x = length of the letters. This approach, quickly becomes unwieldly as the following example illustrates:
getCombos('abc")
yields 81 entries including:
['aaaa',
'aaab',
'aaac',
'aaba',
'aabb',
'aabc',
'aaca',
'aacb',
'aacc',
'abaa',
'abab',
'abac',
'abba',
'abbb',
'abbc',
'abca',
'abcb',
'abcc',
'acaa',
'acab',
'acac',
'acba',
'acbb',
'acbc',
'acca',
'accb',
'accc',
'baaa',
'baab',
'baac',
'baba',
'babb',
'babc',
'baca',
'bacb',
'bacc',
'bbaa',
'bbab',
'bbac',
'bbba',
'bbbb',
'bbbc',
'bbca',
'bbcb',
'bbcc',
'bcaa',
'bcab',
'bcac',
'bcba',
'bcbb',
'bcbc',
'bcca',
'bccb',
'bccc',
'caaa',
'caab',
'caac',
'caba',
'cabb',
'cabc',
'caca',
'cacb',
'cacc',
'cbaa',
'cbab',
'cbac',
'cbba',
'cbbb',
'cbbc',
'cbca',
'cbcb',
'cbcc',
'ccaa',
'ccab',
'ccac',
'ccba',
'ccbb',
'ccbc',
'ccca',
'cccb',
'cccc']