[Answer]-Python string.translate throws type error for string format (ddd)ddd-dddd

1👍

You can force the use of regular string with:

def format_phone(phone_str=None):
    phone_str = phone_str.encode('ascii', 'ignore')
    [...]

as shown here

👤Toff'

Leave a comment