Search Header Logo

Dictionary1

Authored by sabna sathar

Computers

11th - 12th Grade

Used 2+ times

Dictionary1
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Items are accessed by their position in a dictionary

True

False

2.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

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

D = dict()

D = ()

D = []

D = {}

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

is this code correct?
quiz = ("Do you help out at home? ":"yes"      }

No
Yes
Both

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In Python, Dictionaries are immutable

True

False

5.

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) }

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements about dictionary keys in Python is false?

Keys must be immutable

Keys can be of any data type

Keys can be duplicated

Keys are case-sensitive

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements is used to create an empty set?

{ }

set()

[ ]

( )

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

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

Already have an account?