Because the interpreter evaluates the whitespaces beforehand:
In [137]: int(' r n 5 r n ')
Out[137]: 5
This won't work if you make the string raw:
In [138]: int(r' r n 5 r n ')
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-138-bd46e2cccbca> in <module>()
----> 1 int(r' r n 5 r n ')
ValueError: invalid literal for int() with base 10: ' \r \n 5 \r \n '