The str.format() method

The format() method enables formatting the string using braces ({}) as placeholders. In the preceding example, we use total as a placeholder and use the format method of the string class to fill each place holder.