I have a script that loops through a series of four (or less) characters strings. For example:
aaaa
aaab
aaac
aaad
If have been able to implement it with nested for loops like so:
chars = string.digits + string.uppercase + string.lowercase
for a in chars:
print '%s' % a
for b in chars:
print '%s%s' % (a, b)
for c in chars:
print '%s%s%s' % (a, b, c)
for d in chars:
print '%s%s%s%s' % (a, b, c, d)
Is this sort of loop nesting a bad thing, and if so, what would be a better way of accomplishing what I am doing?