case for binary formatting'{ : }format(( * expression (onlybinary format code ' '% (( * valueerrorunsupported format character 'bbin(( * ' '%sbin(( * ' '{}format(bin(( * )' but other more general options work too '%sbin(( * )[ :' slice off to get exact equivalent usable with both method and expression with relative numbering the preceding note showed that general functions could similarly stand in for the format method' thousands groupings optionand more fully support customization in this casea simple -line reusable function buys us the same utility without extra specialcase syntax'{:, }format( ' , , , new str format method feature in '%scommas( ' , , , but is same with simple -line function see the prior note for more comma comparisons this is essentially the same as the preceding bin case for binary formattingbut the commas function here is user-definednot built in as suchthis technique is far more general purpose than precoded tools or special syntax added for single purpose this case also seems indicativeperhapsof trend in python (and scripting language in generaltoward relying more on special-case "batteries includedtools than on general development techniques-- mindset that makes code dependent on those batteriesand seems difficult to justify unless one views software development as an end-user enterprise to someprogrammers might be better served learning how to code an algorithm to insert commas than be provided tool that does we'll leave that philosophical debate aside herebut in practical terms the net effect of the trend in this case is extra syntax for you to have to both learn and remember given their alternativesit' not clear that these extra features of the methods by themselves are compelling enough to be decisive flexible reference syntaxextra complexity and functional overlap the method call also supports key and attribute references directlywhich some may see as more flexible but as we saw in earlier examples comparing dictionary-based formatting in the expression to key and attribute references in the format methodthe string formatting method calls