http://learnpythonthehardway.org/book/ex6.html
Zed seems to use %r and %s interchangeably here, is there any difference between the two? Why not just use %s all the time?
Also, I wasn’t sure what to search for in the documentation to find more info on this. What are %r and %s called exactly? Formatting strings?
They are called string formatting operations.
The difference between %s and %r is that %s uses the
strfunction and %r uses thereprfunction. You can read about the differences betweenstrandreprin this answer, but for built-in types, the biggest difference in practice is thatreprfor strings includes quotes and all special characters are escaped.