人工智能,也就是python语言,是一种高级代码,在程序员的眼里,python就像胶水一样,他可以适应于各种情况,可以以最简单的代码去解决复杂的问题,现阶段python的使用率非常高,知乎就是以python代码编写的网站,而python也可以编写爬取sprider等非常方便的工具,今天达内小编为大家带来,python的基础,希望大家喜欢!

列表 list
# 定义列表的方式
li = [0, 1, 2, 3]
# 或者
li = list()
列表常用方法
def append(self, p_object): # real signature unknown; restored from __doc__
“”“ 追加元素 ”“”
def count(self, value): # real signature unknown; restored from __doc__
“”“ 统计列表元素个数 ”“”
def extend(self, iterable): # real signature unknown; restored from __doc__
“”“ 合并集合 ”“”
def index(self, value, start=None, stop=None): # real signature unknown; restored from __doc__
“”“ 返回指定的值索引 ”“”
def insert(self, index, p_object): # real signature unknown; restored from __doc__
“”“ 在指定的索引处插入 ”“”
def pop(self, index=None): # real signature unknown; restored from __doc__
“”“ 随机删除 ”“”
def remove(self, value): # real signature unknown; restored from __doc__
“”“ 移除 ”“”
def reverse(self): # real signature unknown; restored from __doc__
“”“ 反转输出 ”“”
pass
def sort(self, cmp=None, key=None, reverse=False): # real signature unknown; restored from __doc__
“”“ 按顺序从小到大输出 ”“”
def __len__(self): # real signature unknown; restored from __doc__
“”“ 返回列表长度 ”“”
def __reversed__(self): # real signature unknown; restored from __doc__
“”“ 反转输出 ”“”
def __setitem__(self, i, y): # real signature unknown; restored from __doc__
达内告诉我们,python的代码都很短,更多精彩内容尽在达内