Python practice quiz 6

Python practice quiz 6

Professional Development

18 Qs

quiz-placeholder

Similar activities

SBILD Kochi T20

SBILD Kochi T20

Professional Development

20 Qs

Final Period first quiz

Final Period first quiz

Professional Development

20 Qs

Operador de sistemas CCTV (monitoreo y control)

Operador de sistemas CCTV (monitoreo y control)

Professional Development

16 Qs

Ch-4 masalah ekonomi  pelaporan keu

Ch-4 masalah ekonomi pelaporan keu

KG - Professional Development

18 Qs

Rakor - Pre Test

Rakor - Pre Test

Professional Development

15 Qs

POST TEST ADUM

POST TEST ADUM

Professional Development

20 Qs

G Suite attempte deux

G Suite attempte deux

Professional Development

13 Qs

Pantry Station

Pantry Station

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