Python practice quiz 6

Python practice quiz 6

Professional Development

18 Qs

quiz-placeholder

Similar activities

VCE TalentNext-2021 Quiz-2

VCE TalentNext-2021 Quiz-2

Professional Development

20 Qs

python dictionary and set

python dictionary and set

Professional Development

15 Qs

Basics of Python Programming Unit-1

Basics of Python Programming Unit-1

University - Professional Development

20 Qs

ABREDES - Devasc Python

ABREDES - Devasc Python

Professional Development

14 Qs

Python - CDT

Python - CDT

Professional Development

20 Qs

Day 4 - Advanced Topics

Day 4 - Advanced Topics

Professional Development

20 Qs

HTML, CSS, JS Quiz

HTML, CSS, JS Quiz

Professional Development

20 Qs

CSS basics

CSS basics

Professional Development

15 Qs

Python practice quiz 6

Python practice quiz 6

Assessment

Quiz

Professional Development

Professional Development

Medium

Created by

Assoc.Prof,IT Chennai

Used 1+ times

FREE Resource

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

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?