<jupyter_start><jupyter_text>Given: A collection of at most 10 symbols defining an ordered alphabet, and a positive integer n (n≤10).Return: All strings of length n that can be formed from the alphabet, ordered lexicographically (use the standard order of symbols in the English alphabet).<jupyter_code>def indexing(s: List[str], n: int) -> str:
    s.sort()
    for p in itertools.product(s, repeat=n):
        print(''.join(p))
# Try sample dataset
s = ['A', 'C', 'G', 'T']
n = 2
indexing(s, n)
# Try Rosalind dataset
with open(data_dir/"rosalind_lexf.txt", 'r') as f:
    s = list(f.readline().rstrip().split())
    n = int(f.readline().rstrip())
    indexing(s, n)<jupyter_output>AAA
AAB
AAC
AAD
AAE
AAF
ABA
ABB
ABC
ABD
ABE
ABF
ACA
ACB
ACC
ACD
ACE
ACF
ADA
ADB
ADC
ADD
ADE
ADF
AEA
AEB
AEC
AED
AEE
AEF
AFA
AFB
AFC
AFD
AFE
AFF
BAA
BAB
BAC
BAD
BAE
BAF
BBA
BBB
BBC
BBD
BBE
BBF
BCA
BCB
BCC
BCD
BCE
BCF
BDA
BDB
BDC
BDD
BDE
BDF
BEA
BEB
BEC
BED
BEE
BEF
BFA
BFB
BFC
BFD
BFE
BFF
CAA
CAB
CAC
CAD
CAE
CAF
CBA
CBB
CBC
CBD
CBE
CBF
CCA
CCB
CCC
CCD
CCE
CCF
CDA
CDB
CDC
CDD
CDE
CDF
CEA
CEB
CEC
CED
CEE
CEF
CFA
CFB
CFC
CFD
CFE
CFF
DAA
DAB
DAC
DAD
DAE
DAF
DBA
DBB
DBC
DBD
DBE
DBF
DCA
DCB
DCC
DCD
DCE
DCF
DDA
DDB
DDC
DDD
DDE
DDF
DEA
DEB
DEC
DED
DEE
DEF
DFA
DFB
DFC
DFD
DFE
DFF
EAA
EAB
EAC
EAD
EAE
EAF
EBA
EBB
EBC
EBD
EBE
EBF
ECA
ECB
ECC
ECD
ECE
ECF
EDA
EDB
EDC
EDD
EDE
EDF
EEA
EEB
EEC
EED
EEE
EEF
EFA
EFB
EFC
EFD
EFE
EFF
FAA
FAB
FAC
FAD
FAE
FAF
FBA
FBB
FBC
FBD
FBE
FBF
FCA
FCB
FCC
FCD
FCE
FCF
FDA
FDB
FDC
FDD
FDE
FDF
FEA
FEB
FEC
FED
FEE
FEF
FFA
FFB
FFC
FFD
FFE
FFF
StarcoderdataJupyterStructuredCleanDedup