ResNetCode Analyse

BONUS:

1.parameter *

3meanings

*-->tuple&decompressing parameter list

**-->Dict

eg:tuple Dict

>>> def foo(a, b=10, *args, **kwargs):
        print a
        print b
        print args
        print kwargs
>>> foo(1, 2, 3, 4, e=5, f=6, g=7)
1
2
3 4
{'e': 5, 'g': 7, 'f': 6}

eg:Decompression

>>> def foo(bar, lee):
        print bar, lee
>>> l = [1, 2]
>>> foo(*l)
1 2

https://www.cnblogs.com/arkenstone/p/5695161.html 

 

上一篇:自然语言关键词提取


下一篇:SE复习/Wiederholung