![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
CS启蒙
FeelingFannie
这个作者很懒,什么都没留下…
展开
-
return +判断列表A包含列表B的所有元素
Returndef fun1(): return x = 1SyntaxError: invalid syntaxdef fun1(): x = 1 return x Decide whether all the elements of List A are in List BlistA = [1, 2, 3]listB = [1, 2, 3, 4]listB contains listAlistA = [1, 2, 3]listB = [1, 2, 3, 4]原创 2020-07-16 12:06:38 · 431 阅读 · 0 评论 -
复制词典与列表
when copying a dict:aDict.copy()if you try to use aDict[:]TypeError: unhashable type: ‘slice’Python definition of Hashable is: An object is hashable if it has a hash value which never changes during its lifetime (it needs a hash() method).A list is原创 2020-07-16 11:49:42 · 141 阅读 · 0 评论