0

For example if you have a list of letters: "ABCDEFG" And in the second input you put a list of numbers: "1346527" The output would be: "ACDFEBG" Is that possible and if so how?

1 Answers1

0

Simply:

s = "ABCDEFG"

t = "1346527"

for x in t:
    print(s[int(x) - 1], end="")

Output:

ACDFEBG
Synthase
  • 5,849
  • 2
  • 12
  • 34