Question: what is the difference between r and s in python?
Answer: The %s specifier converts the object using str(), and %r converts it using repr(). ... For example, if you have a string with endline characters, %s would actually show stuff on new lines while %r would just give the output as \n and also keep the quotes intact.