Python practice quiz 6

Python practice quiz 6

Professional Development

18 Qs

quiz-placeholder

Similar activities

METHODE DISC

METHODE DISC

Professional Development

15 Qs

Architecture

Architecture

Professional Development

13 Qs

Chain of Command - NJROTC

Chain of Command - NJROTC

9th Grade - Professional Development

18 Qs

Pedagogik

Pedagogik

Professional Development

20 Qs

DAY1

DAY1

Professional Development

15 Qs

Customer Service

Customer Service

Professional Development

15 Qs

Compliance Test FF/CD/Onco

Compliance Test FF/CD/Onco

Professional Development

15 Qs

PRE POST CUSTOMER PROFILING

PRE POST CUSTOMER PROFILING

Professional Development

20 Qs

Python practice quiz 6

Python practice quiz 6

Assessment

Quiz

Professional Development

Professional Development

Practice Problem

Medium

Created by

Assoc.Prof,IT Chennai

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

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

18 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

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

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

print(d)

“john”, 40, “peter”, 45

{‘john’: 40, ‘peter’: 45}

40 and 45

d = (40:”john”, 45:”peter”)

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

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

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

>>> "john" in d

true

false

none

eror

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

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

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

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

d1 > d2

true

false

error

none

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Suppose d = {“john”:40, “peter”:45}, to delete the entry for “john” what command do we use?

d.delete(“john”:40)

d.delete(“john”)

del d[“john”]

del d(“john”:40)

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

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

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

print(list(d.keys()))

[“john”, “peter”]

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

(“john”, “peter”)

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

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of these about a dictionary is false?

The values of a dictionary can be accessed using keys

The keys of a dictionary can be accessed using values

Dictionaries aren’t ordered

Dictionaries are mutable

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

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

a={1:"A",2:"B",3:"C"}

print(a.get(1,4))

1

A

4

invalid syntax for get method

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 Professional Development