Search Header Logo

Python Quizz-11

Authored by shilpa gupta

Computers

University

Used 25+ times

Python Quizz-11
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

30 sec • 1 pt

Which of the following statements create a dictionary?

d = {}

d = {“john”:40, “peter”:45}

d = {40:”john”, 45:”peter”}

All of the mentioned

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code snippet?

d = {"john":40, "peter":45}

print("john" in d)

True

False

None

Error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

d1 = {"john":40, "peter":45}

d2 = {"john":466, "peter":45}

print(d1 == d2)

True

False

None

Error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

d1 = {"john":40, "peter":45}

d2 = {"john":466, "peter":45}

print(d1 > d2)

True

False

Error

None

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

d = {"john":40, "peter":45}

print(d["john"])

45

40

john

error

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Suppose d = {“john”:40, “peter”:45}. To obtain the number of entries in dictionary which command do we use?

d.size()

len(d)

size(d)

d.len()

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

d = {"john":40, "peter":45}

print(list(d.keys()))

[“john”, “peter”]

[“john”:40, “peter”:45]

(“john”, “peter”)

(“john”:40, “peter”:45)

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?

Discover more resources for Computers