The r means that the string is to be treated as a raw string, which means all escape codes will be ignored.
For an example:
'n' will be treated as a newline character, while r'n' will be treated as the characters followed by n

The r means that the string is to be treated as a raw string, which means all escape codes will be ignored.
For an example:
'n' will be treated as a newline character, while r'n' will be treated as the characters followed by n