How come string.maketrans does not work in Python 3.1?
You don't need to use bytes.maketrans()
when str
would be simpler and eliminate the need for the 'b' prefix:
print("Swap vowels for numbers.".translate(str.maketrans('aeiou', '12345')))
Stop trying to learn Python 3 by reading Python 2 documentation.
intab = 'aeiou'
outtab = '12345'
s = 'this is string example....wow!!!'
print(s.translate({ord(x): y for (x, y) in zip(intab, outtab)}))