Question
What is the output of the following?print('abcd'.translate({'a': '1', 'b': '2', 'c': '3', 'd': '4'}))
Answer: Option A
Was this answer helpful ?
The function translate expects a dictionary of integers. Use maketrans() instead of doing the above.
Was this answer helpful ?
Submit Solution