def join(self, iterable): # real signature unknown; restored from __doc__ """ S.join(iterable) -> str Return a string which is the concatenation of the strings in the iterable. The separator between elements is S. """ 上面是库…
############### 函数的定义调用,返回值和返回值接收 ############## def mylen(): s = "myname" i = 0 for item in s: i += 1 return i def func(): return {"name":"andy"},[1,2,3] l = mylen() print(func()) # 从这个例子可以学到几个:函数的定义,函数的调用,函数的返回值, # 关于…
目录 说明 数据说明 正确示例 错误示例 解决办法 说明 最近在用Python的join函数连接多个列表时,出现了如下两个错误,即合并类型不一致.折腾了很久才找到原因,真是基础不牢,地动山摇. TypeError: sequence item 3: expected str instance, int found 或 TypeError: can only concatenate list (not "str") to list 数据说明 a = ['a','c','c'] b = […