rječnici Flashcards

1
Q

d.keys()

A

vraća ključeve u obliku liste

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

d.values()

A

vraća vrijednosti u obliku liste

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

d.items()

A

vraća listu uređenih parova

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

sorted(d)

A

vraća sortiranu listu ključeva uzlazno

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

sorted(d.items())

A

vraća sortiranu listu po ključevima

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

d.update(drugi)

A

dodaje rječniku d rječnik drugi; za one ključeve koji su već u d uzima vrijednost iz drugi

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

d.get(k)

A

vraća vrijednost d[k]; ako ključ ne postoji u rječniku vraća None

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

d.get(k,x)

A

vraća vrijednost d[k]; ako ključ ne postoji u rječniku vraća ?

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

d.setdefault(k,x)

A

isto kao i d.get(k,x)+uvodi d[k]=x

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

d.clear()

A

briše sve elemente; ostaje prazan rječnik

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

sorted(k,[key=f],[reverse=True/False]

A

?

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

del(d[k])

A

briše ključ i vrijednost

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