The difference between %s and %r is that %s uses the str function and %r uses the repr function.
but for built-in types, the biggest difference in practice is that repr for strings includes quotes and all special characters are escaped.
As mentioned by KfirWe , the %r uses the repr() function when representing a value while %s uses the str() function. While the purpose of str() is to represent that value in a readable way to the developer and normal user alike, repr() is used to represent the Python object in a way that could be useful to the developer. For most cases, it will output the same thing as str(), but in other cases (generally involving objects) will output more specific information (this forum explains it quite well - https://www.quora.com/What-are-the-differences-among-s-r-and-d-in-Python )
Only understood somewhat
If I can use %r more practically, for debugging I will understand it better.
I wish I was software engineer working on Python
But I am working with books, Python crash course & Learn python the hardway 3