Dec-10-2019, 07:55 PM
You are asking complicated things. Are you inventing a new encryption mechanism?
You may solve it in this way:
You may solve it in this way:
s1 = '085236752048' s2 = '@ABCDEFGHI' print(''.join(s2[int(ch)] for ch in s1[6:11]))
Output:GEB@D
Explanation:for ch in s1[6:11]
: Walk through the numbers in string 1 (mind you: index starts at 0 and last index is not included)s2[int(ch)]
: make an integer of the character found in the loop and consider this as an index in string 2.''.join(...)
: start with an empty string and join this successively with the characters found.