s3 = 'abcd'
d = {a:'а', b:'б', c:'ц', d:'д'}
for smbl in s3:
if smbl in d.keys():
print(d[smbl], end='')
for smbl in s3:
if smbl in d.values:
print(d[smbl], end='')
keys = "abcd"
dd = {"a": 1, "b": 2, "c": 3, "d": 4}
for key in keys:
print(dd[key])
In [1]: e = 'abcd'
In [2]: r = 'абцд'
In [3]: m = str.maketrans(e,r)
In [4]: 'abbcc'.translate(m)
Out[4]: 'аббцц'
In [5]: m = str.maketrans(r,e)
In [6]: 'цааб'.translate(m)
Out[6]: 'caab'