• sequence in python


    string, list and tuple are type of the sequence in python, that can be "traverse” or “iterate", and you can get the element of the list use the way of the array in C, like: list[index].

    This is some functions in the help of the list:

     |  append(...)
     |      L.append(object) -- append object to end
     |  
     |  count(...)
     |      L.count(value) -> integer -- return number of occurrences of value
     |  
     |  extend(...)
     |      L.extend(iterable) -- extend list by appending elements from the iterable
     |  
     |  index(...)
     |      L.index(value, [start, [stop]]) -> integer -- return first index of value.
     |      Raises ValueError if the value is not present.
     |  
     |  insert(...)
     |      L.insert(index, object) -- insert object before index
     |  
     |  pop(...)
     |      L.pop([index]) -> item -- remove and return item at index (default last).
     |      Raises IndexError if list is empty or index is out of range.
     |  
     |  remove(...)
     |      L.remove(value) -- remove first occurrence of value.
     |      Raises ValueError if the value is not present.
     |  
     |  reverse(...)
     |      L.reverse() -- reverse *IN PLACE*
     |  
     |  sort(...)
     |      L.sort(key=None, reverse=False) -- stable sort *IN PLACE*
     
  • 相关阅读:
    未来行业
    百度网盘搜索方法
    JavaScript继承详解
    Win 7下破解Loadrunner 11(带中文版下载地址)
    NET下RabbitMQ实践[WCF发布篇]
    NET下RabbitMQ实践[示例篇]
    NET下RabbitMQ实践[配置篇]
    8个超炫的 Web 效果
    Windows下安装zip包解压版mysql
    键盘上相当于鼠标右键的快捷键和电脑快捷键大全
  • 原文地址:https://www.cnblogs.com/henyihanwobushi/p/2663308.html
Copyright © 2020-2023  润新知