For reference, you should know that you can simplify how you use .format().
A line like "{title} by {author}".format(title = self.title, author = self.author) can be reduced to
"{} by {}".format(self.title, self.author). You usually add the variable names/numbers in the curly braces when you want the variables to appear in a different order than you pass them into .format().
For reference, you should know that you can simplify how you use
.format()
. A line like"{title} by {author}".format(title = self.title, author = self.author)
can be reduced to"{} by {}".format(self.title, self.author)
. You usually add the variable names/numbers in the curly braces when you want the variables to appear in a different order than you pass them into.format()
.