BigSmall 发表于 2018-10-22 09:44:45

列表

关于列表里面的list.append(),这里不太理解,之前学的math.sin()是相似的吗?但是这里怎么没有import
谢谢大佬

claws0n 发表于 2018-10-22 09:46:39

list 是基本数据结构,append 是 list 这一个类的内建函数,不需要额外导入

塔利班 发表于 2018-10-22 09:56:56

list是内置序列,append是其内置函数,
需要导入的都在其他模块里

BigSmall 发表于 2018-10-22 10:21:32

塔利班 发表于 2018-10-22 09:56
list是内置序列,append是其内置函数,
需要导入的都在其他模块里

那是不是:
math是一种外置序列,sin函数是其内置函数,所以用到sin函数的时候,需要把math序列import
而列表是内置序列,可以直接用,不需要import

BigSmall 发表于 2018-10-22 10:22:12

claws0n 发表于 2018-10-22 09:46
list 是基本数据结构,append 是 list 这一个类的内建函数,不需要额外导入

非常感谢

塔利班 发表于 2018-10-22 10:30:25

BigSmall 发表于 2018-10-22 10:21
那是不是:
math是一种外置序列,sin函数是其内置函数,所以用到sin函数的时候,需要把math序列import
...

math不是序列是个模块,需要从别的地方导入的
list,tuple,字符串,集合,字典才是序列

BigSmall 发表于 2018-10-22 10:35:10

塔利班 发表于 2018-10-22 10:30
math不是序列是个模块,需要从别的地方导入的
list,tuple,字符串,集合,字典才是序列

好的,谢谢{:10_275:}
页: [1]
查看完整版本: 列表