python中的format函数

91 阅读1分钟
def format(self, *args, **kwargs): # known special case of str.format
    """
    S.format(*args, **kwargs) -> str
    
    Return a formatted version of S, using substitutions from args and kwargs.
    The substitutions are identified by braces ('{' and '}').
    """
    pass

def format(self, *args, **kwargs):

str.format 的已知特例

S.format(*args, **kwargs) -> str

返回 S 的格式化版本,使用 args 和 kwarg 的替换。

替换由大括号(“{”和“}”)标识。

通过