Currently working on a small personal project. I am trying to code an iteration block, which will give me all the possible outcomes from my selected inputs. The first 4 characters of the output need to be a-to-z, and the last 2 characters need to be 1-to-9. Here is what I have got so far.
url = 'www.example.com/' list_1 = string.ascii_lowercase list_2 = string.ascii_lowercase list_3 = string.ascii_lowercase list_4 = string.ascii_lowercase list_5 = list(range(0, 9)) list_6 = list(range(0, 9)) a = list_1, list_2, list_3, list_4, list_5, list_6 all_combos = list(itertools.permutations(a,6)) print(all_combos)
Essentially I would be looking for it to return something like: [aaaa01, aaaa02,…] and so on, all the way through to zzzz99.
I can’t seem to get it to iterate INSIDE of the lists. Instead it just iterates the lists. I was thinking that perhaps I could make a ‘for - in -’ on all of the lists to get them to iterate through, but I have no idea how to do so (im relatively new to both coding and Python).
I have looked online but none of the tutorials relate to the exact thing I am trying to do, and the documentation for itertools is hella confusing to me.
The final product should print me a load of possible URL’s that I can then click on.
I have also imported the following:
import itertools import string import tabulate
Any help would be massively appreciated, and if you can spare the time to explain the solution to me, that would be even better.