元组tuple魔法

tu = (11,22,33,44)
tu.count(22) 获取指定元素在元组中出现的次数


tu.index(22) 获取指定元素在元组中的位置

。

 

posted @ 2019-11-21 16:13  一届俗人  阅读(75)  评论(0)    收藏  举报