To start from the "F", just... put the "F" at the beginning. But then it was not clear what you want...
You want it to start from "F" and then go to "Z", excluding all combinations that have the letters from "A" to "E"?
In that case, just use itertools.product(ascii_uppercase[5:], repeat=3)
<-- the Slice [5:]
take only from "F" onwards (ignoring the letters of "A" and "E"). With this, combinations such as "FAA" and "FEB" will be excluded.
Or you want it to start from the "F", but also include all letters?
In this case, simply rearrange the letters by placing the "F" at the beginning:
letras = 'F' + ascii_uppercase[:5] + ascii_uppercase[6:]
for seq in itertools.product(letras, repeat=3):
etc...
The Slice [:5]
take the letters from "A" to "E", and [6:]
takes everything from the "G" onwards (up to the "Z"). So, letras
will be FABCDEGHIJKLMNOPQRSTUVWXYZ
: you will have all letters (and therefore all possible combinations), but now the first ones will be "FF11111", "FF11112", etc.
Use comments for non-technical information.
– Augusto Vasques
If one of the answers below solved your problem and there was no doubt left, choose the one you liked the most and mark it as correct/accepted by clicking on the " " that is next to it, which also marks your question as solved. If you still have any doubt or would like further clarification, feel free to comment. If there are still doubts see How and why to accept an answer?
– Augusto Vasques