m-ten / pwp-capstones

0 stars 0 forks source link

Using .format() #1

Open hmontero1205 opened 6 years ago

hmontero1205 commented 6 years ago

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().