How can I convert special characters in a string back into escape sequences? April 20, 2023 by Tarik print(repr('a\tb')) repr() gives you the “representation” of the string rather than the printing the string directly.