re.escape result

Report a typo

Write down the string that re.escape() returns, supposing that the version of Python is 3.7 or higher.

string = 'Backslash?'
string = re.escape(string)

Tip: Remember that re.escape() escapes metacharacters by means of two backslashes. They turn into one backslash only when you output the string with print(string).

Enter a short text
___

Create a free account to access the full topic