Python Dictionary

Python Dictionary

10 Qs

quiz-placeholder

Similar activities

CONOCIMIENTOS PREVIOS CUARTO PRIMARIA

CONOCIMIENTOS PREVIOS CUARTO PRIMARIA

4th Grade

10 Qs

PENILAIAN HARIAN 1 - TIK KELAS 3 - SDT KN

PENILAIAN HARIAN 1 - TIK KELAS 3 - SDT KN

1st Grade

10 Qs

ICT Yr 1 - The Windows Desktop

ICT Yr 1 - The Windows Desktop

1st Grade

10 Qs

Bài 19. Tạo và làm việc với bảng

Bài 19. Tạo và làm việc với bảng

Professional Development

10 Qs

Tes Awal Modul 5

Tes Awal Modul 5

University

10 Qs

Pre-Test: Search Engine

Pre-Test: Search Engine

7th Grade

10 Qs

Lesson 1 Introduction to Database System

Lesson 1 Introduction to Database System

10th Grade

10 Qs

Tutorium 1 - Prog2

Tutorium 1 - Prog2

University

11 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?