美文网首页
2018-09-27

2018-09-27

作者: 战狼渐渐 | 来源:发表于2018-09-28 20:59 被阅读0次

    [('foo', 1, 2), ('bar', 'hello'), ('foo', 3, 3)]

    >>> def dofoo(x,y):

    print('foo',x,y)

    >>> def dobar(s):

    print('bar',s)

    >>> for tag,*args in records:

    print(tag,args)

    foo [1, 2]

    bar ['hello']

    foo [3, 3]

    >>> for tag,*args in records:

    print(args)

    [1, 2]

    ['hello']

    [3, 3]

    >>>

    相关文章

      网友评论

          本文标题:2018-09-27

          本文链接:https://www.haomeiwen.com/subject/oyzyoftx.html