基本数据类型之元组

总结下元组的方法(tuple):

def count(self, value): # real signature unknown; restored from __doc__
     --统计元组中某个元素存在的个数

    """ T.count(value) -> integer -- return number of occurrences of value """
    return 0

def index(self, value, start=None, stop=None): # real signature unknown; restored from __doc__
      -- 获取列表中某个元素在元组中的索引值

    """
    T.index(value, [start, [stop]]) -> integer -- return first index of value.
    Raises ValueError if the value is not present.
    """
    return 0

没错,就这两个,其实元组用的不多,记不记住这两个方法无所谓。

******元组的特点:
最主要的特点就是不可修改

posted @ 2024-06-24 09:15  疯狂Python  阅读(13)  评论(0)    收藏  举报