Set Methods Flashcards

1
Q

remove()

A

removes element from the set

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

add()

A

adds element to a set

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

copy()

A

returns shallow copy of a set

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

clear()

A

remove all elements from a set

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

difference()

A

returns difference of two sets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

difference_update()

A

updates calling set with intersection of sets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

discard()

A

removes an element from the set

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

intersection()

A

returns intersection of two or more sets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

intersection_update()

A

updates calling set with intersection of sets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

isdisjoint()

A

checks disjoint sets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

issubset()

A

checks if a set is subset of another set

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

pop()

A

remives an arbitrary element

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

symmetric_difference()

A

returns symmetric difference

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

symmetric_difference_update()

A

updates set with symmetric difference

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

union()

A

returns union of sets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

update()

A

add elements to the set

17
Q

any()

A

checks if any element of an iterable is true

18
Q

all()

A

returns true when all elements in iterable is true

19
Q

ascii()

A

returns string containing printable representation

20
Q

bool()

A

converts a value to boolean

21
Q

enumerate()

A

returns an enumerate object

22
Q

filter()

A

constructs iterator from elements which are true

23
Q

frozenset()

A

returns immutable frozenset object

24
Q

iter()

A

returns iterator for an object

25
Q

len()

A

returns length of an object

26
Q

max()

A

returns largest element

27
Q

min()

A

returns smallest element

28
Q

map()

A

applies funciton and returns a list

29
Q

set()

A

returns a python set

30
Q

sorted()

A

returns sorted list from a given iterable

31
Q

sum()

A

add items of an iterable

32
Q

zip()

A

returns an iterator of tuples