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?
Asked
Active
Viewed 29 times
1 Answers
0
Simply:
s = "ABCDEFG"
t = "1346527"
for x in t:
print(s[int(x) - 1], end="")
Output:
ACDFEBG

Synthase
- 5,849
- 2
- 12
- 34