CC103 - 2

CC103 - 2

University

40 Qs

quiz-placeholder

Similar activities

PART 1 ED 204

PART 1 ED 204

University

45 Qs

Программалау сұрақтары

Программалау сұрақтары

University

37 Qs

ORTHO II - Classification of malocclusion

ORTHO II - Classification of malocclusion

University

44 Qs

Câu hỏi về Dataframe trong Python

Câu hỏi về Dataframe trong Python

University

35 Qs

SQL Transaction and Trigger Quiz

SQL Transaction and Trigger Quiz

University

40 Qs

The Self in Western and Oriental / Eastern Thought

The Self in Western and Oriental / Eastern Thought

University

35 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

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?