The backslash "\" character is used to escape characters that otherwise have a special meaning. There are various meanings of it such as newline, backslash itself, or the quote character.
You can compare it using a simple if statement. For example, refer to the following code -
if data.value[0] in ('/', '\\'):
my_func()