Dictionary Methods Flashcards

1
Q

clear()

A

removes all items

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

copy()

A

returns shallow copy of a dictionary

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

fromkeys()

A

creates fictionary from given sequence

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

get()

A

returns value of the key

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

items()

A

returns view of dictionary’s (key, value) pair

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

keys()

A

returns view object of all keys

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

popitem()

A

returns & removes element from dictionary

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

setdefault()

A

inserts key with a value if key is not present

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

pop()

A

removes and returns element having given key

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

values()

A

returns view of all values in dictionary

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

update()

A

updates the dictionary

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

any()

A

checks if any element of an iterable is true

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

all()

A

returns true when all elements in iterable is true

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

ascii()

A

returns string containing printable representation

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

bool()

A

converts a value to Boolean

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

dict()

A

creates a dictionary

17
Q

enumerate()

A

returns an enumerate object

18
Q

filter()

A

constructs iterator from elements which are true

19
Q

iter()

A

returns iterator for an object

20
Q

len()

A

returns length of an object

21
Q

max()

A

returns largest element

22
Q

min()

A

returns smallest element

23
Q

map()

A

applies funciton and returns a list

24
Q

sorted()

A

returns sorted list from a given iterable

25
Q

sum()

A

add items of an iterable

26
Q

zip()

A

returns an iterator of tuples