CC103 - 2

CC103 - 2

University

40 Qs

quiz-placeholder

Similar activities

Pyetje mbi PHP dhe Zhvillimin e Uebit

Pyetje mbi PHP dhe Zhvillimin e Uebit

University

43 Qs

CC103 - Part 2

CC103 - Part 2

University

40 Qs

CC103-1

CC103-1

University

40 Qs

information and communication technologies

information and communication technologies

University

45 Qs

Câu hỏi về Excel

Câu hỏi về Excel

University

42 Qs

Ciclos repetitivos: MIENTRAS

Ciclos repetitivos: MIENTRAS

University

35 Qs

Oops Quiz

Oops Quiz

University

40 Qs

(A2) We bought a zoo

(A2) We bought a zoo

University

39 Qs

CC103 - 2

CC103 - 2

Assessment

Quiz

Others

University

Hard

Created by

ALVIN CERTEZA

FREE Resource

40 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of: d = {'a': 1, 'b': 2} print(d['c'])

None

0

Error

[]

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method returns a list of key-value tuple pairs?

keys()

values()

items()

get()

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How to safely access a key that may not exist in a dictionary?

dict['key']

dict.get('key')

dict.key

dict.fetch('key')

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of len({'a': 1, 'b': 2, 'a': 3})?

3

2

1

Error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does dict.update({'c': 3}) do?

Adds key 'c' with value 3

Replaces dictionary

Clears dictionary

Returns error

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will dict.pop('x') do if 'x' does not exist?

Returns None

Raises KeyError

Deletes key

Returns 0

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How to loop over dictionary keys and values? for k, v in ___: ...

dict

dict.items()

dict.keys()

dict.values()

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?