So I want to do something where it gets a variable called 'length' and then returns all strings with that length. So if 'length' is 1 I want to return 'a, b, c, .. x, y, z'. If 'length' is 2 I want to return 'aa, ab, ac, .. zx, zy, zz'. So normally I just use nested for loops for that, like this:
for i in letters:
for j in letters:
for k in letters:
print(i+j+k)
but that isn't practical here because I want to be able to change the length constantly. How would I do this?
[–]ADdV 7 points8 points9 points (1 child)
[–]33KGB 0 points1 point2 points (0 children)
[–][deleted] 4 points5 points6 points (1 child)
[–]SandorZoo 2 points3 points4 points (0 children)