Skip to content

Instantly share code, notes, and snippets.

@mrkatey
Created March 18, 2022 08:57
Show Gist options
  • Save mrkatey/2a294f18e2ef38736d3fe7603288c81a to your computer and use it in GitHub Desktop.
Save mrkatey/2a294f18e2ef38736d3fe7603288c81a to your computer and use it in GitHub Desktop.
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