问答详情
源自:2-1 tuple功能详解

name, *other 是讲name_tuple拆成 第一个和其他 如果我想要第N个 和其他呢?

name, *other 是讲name_tuple拆成 第一个和其他 如果我想要第N个 和其他呢?比如我知道我知道第N个是age 我想拆成age和其他 但是我不能写age,*other 这样会把tuple里面第一个 bobby读作name 所以有方法吗?

提问者:亦余心之所善兮灬 2018-07-24 19:50

个回答

  • 阿德罗斯
    2018-07-29 15:49:08

    https://img4.mukewang.com/5b5d716e000101bb02210109.jpg

    可以这样倒着使用,other不必要非是写在后边