Python Dictionary

Python Dictionary

10 Qs

quiz-placeholder

Similar activities

Pint of Science Carballo Día 3

Pint of Science Carballo Día 3

University

10 Qs

Ôn tập KT HKII Lớp 4 23 24

Ôn tập KT HKII Lớp 4 23 24

4th Grade

15 Qs

10 câu kiểu xâu tiết 1

10 câu kiểu xâu tiết 1

11th Grade

10 Qs

ÔN TẬP CK2 - TIN HỌC 5 - 22.23 - Phần 2

ÔN TẬP CK2 - TIN HỌC 5 - 22.23 - Phần 2

3rd Grade

10 Qs

Cuestionario Steve Jobs

Cuestionario Steve Jobs

12th Grade - University

10 Qs

Sistema Operativo Android

Sistema Operativo Android

9th - 12th Grade

10 Qs

bài tập câu lệnh đk

bài tập câu lệnh đk

8th Grade

15 Qs

CONOCIMIENTOS PREVIOS SEXTO PRIMARIA

CONOCIMIENTOS PREVIOS SEXTO PRIMARIA

6th Grade

10 Qs

Python Dictionary

Python Dictionary

Assessment

Quiz

Computers

Practice Problem

Medium

Created by

ASIER SOLUTIONS

Used 36+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a valid way to define this dictionary in Python:

d = dict([

('foo', 100),

('bar', 200),

('baz', 300)

])

d = {}

d['foo'] = 100

d['bar'] = 200

d['baz'] = 300

d = dict(foo=100, bar=200, baz=300)

d = {'foo': 100, 'bar': 200, 'baz': 300}

d = { ('foo', 100), ('bar', 200), ('baz', 300) }

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Consider this dictionary:


d = {'foo': 100, 'bar': 200, 'baz': 300}


What is the result of this statement:


d['bar':'baz']

It raises an exception

(200, 300)

200 300

[200, 300]

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

A Python dictionary stores ...

value - key pairs

key - value pairs

4.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

Which of the following create an empty dictionary (D)?

D = dict()

D = ()

D = []

D = {}

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which symbol surrounds a dictionary?

{
(
[
:

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Please select all correct ways to empty the following dictionary

student = {

"name": "Emma",

"class": 9,

"marks": 75

}

del student

del student[0:2]

student.clear()

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

________________method will returns number of key-value pairs in the given dictionary.

len( )

pop( )

del( )

keys( )

values( )

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?