Created
March 18, 2022 08:57
-
-
Save mrkatey/2a294f18e2ef38736d3fe7603288c81a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
names = ["Smith", "Leeson", "Markcano"] | |
starts = [a[0:2] for a in names] | |
ends = [name[::-1][0:2][::-1] for name in names] | |
mids = [name[2:-2] for name in names] | |
new_names = set() | |
for s in starts: | |
for m in mids: | |
for e in ends: | |
new_name = f"{s}{m}{e}" | |
new_names.add(new_name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment