String.maketrans for English and Persian numbers
问题 I have a function like this: persian_numbers = '۱۲۳۴۵۶۷۸۹۰' english_numbers = '1234567890' arabic_numbers = '١٢٣٤٥٦٧٨٩٠' english_trans = string.maketrans(english_numbers, persian_numbers) arabic_trans = string.maketrans(arabic_numbers, persian_numbers) text.translate(english_trans) text.translate(arabic_trans) I want it to translate all Arabic and English numbers to Persian. But Python says: english_translate = string.maketrans(english_numbers, persian_numbers) ValueError: maketrans arguments