If I have a string
s = 'this is a \n tennis ball'
and if perform in python:
s.replace("\n", "nice")
the output is:
"this is a nice tennis ball"
On the other hand if I perform in python
s.replace(r"\n","nice"),
the output is
"this is a \n tennis ball"
What is the difference between using simple plain string and using r
raw string and what is the reason for these different outputs.