CC103 - Part 2

CC103 - Part 2

University

40 Qs

quiz-placeholder

Similar activities

Computer basics

Computer basics

University

36 Qs

AI and Deepfakes Quiz

AI and Deepfakes Quiz

12th Grade - University

40 Qs

Алгоритм 38

Алгоритм 38

University

38 Qs

CC103 - 2

CC103 - 2

University

40 Qs

Supervisión y monitoreo

Supervisión y monitoreo

University

39 Qs

Đề Cương Ôn Tập Giữa Kỳ 2 - Môn Tin Học

Đề Cương Ôn Tập Giữa Kỳ 2 - Môn Tin Học

University

45 Qs

IT and Business Alignment Quiz

IT and Business Alignment Quiz

University

44 Qs

CC103 - Part 2

CC103 - Part 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?