Set Methods Flashcards

(32 cards)

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
len()
returns length of an object
26
max()
returns largest element
27
min()
returns smallest element
28
map()
applies funciton and returns a list
29
set()
returns a python set
30
sorted()
returns sorted list from a given iterable
31
sum()
add items of an iterable
32
zip()
returns an iterator of tuples