This is a pretty simple task i feel like i should be able to do- but just for the life of me, cant figure out.
I'm trying to write a recursive function to replicate the following:
chars = '0123456789abcdef'
for a in chars:
for b in chars:
for c in chars:
for d in chars:
print a+b+c+d
searching for an example hasn't proven very fruitful.
code thats not working:
chars = 'ABCDEF'
def resu(chars, depth = len(chars)):
for char in chars:
if depth == 0:
return char
return char + resu(chars, depth - 1)
print resu(chars)