1、三元运算符
result
=
值
1
if
条件
else
值
2
# 如果条件成立,那么将 “值1” 赋值给result变量,否则,将“值2”赋值给result变量
2、set
set集合,是一个无序且不重复的元素集合
class set(object):
"""
set() -> new empty set object
set(iterable) -> new set object
Build an unordered collection of unique elements.
"""
def add(self, *args, **kwargs): # real signature unknown
"""
Add an element to a set,添加元素
This has no effect if the element is already present.
"""
pass
def clear(self, *args, **kwargs): # real signature unknown
""" Remove all elements from this set. 清除内容"""
pass
def copy(self, *args, **kwargs): # real signature unknown
""" Return a shallow copy of a set. 浅拷贝 """
pass
def difference(self, *args, **kwargs): # real signature unknown
"""
Return the difference of two or more sets as a new set. A中存在,B中不存在
(i.e. all elements that are in this set but not the others.)
"""
pass
def difference_