注意是直接使用, 而不是str.format这种调用, 网上找的全是str.format的调用方式.
文档:
Signature: format(value, format_spec='', /)
Docstring:
Return value.__format__(format_spec)
format_spec defaults to the empty string.
See the Format Specification Mini-Language section of help('FORMATTING') for
details.
因为看不懂, 用不来, 然而format又是内置的函数, 所以就想请问问这个函数直接使用应该如何使用?
Built-in Functions — Python 3.7.3 documentation
bin(x)
这个例子里,有format()
的一个示例