import itertools
list(itertools.product('ABCD', repeat=2))
Out[34]:
[('A', 'A'),
('A', 'B'),
('A', 'C'),
('A', 'D'),
('B', 'A'),
('B', 'B'),
('B', 'C'),
('B', 'D'),
('C', 'A'),
('C', 'B'),
('C', 'C'),
('C', 'D'),
('D', 'A'),
('D', 'B'),
('D', 'C'),
('D', 'D')]
If it's your first time programming, please watch the tutorial and proceed with the pre-learning.
© 2024 OneMinuteCode. All rights reserved.