python dictionary

python dictionary

University

10 Qs

quiz-placeholder

Similar activities

PYTHON QUIZ2

PYTHON QUIZ2

University - Professional Development

10 Qs

Python Quiz Infytq

Python Quiz Infytq

University

10 Qs

Advance Module Python

Advance Module Python

University

15 Qs

แบบทดสอบความรู้เกี่ยวกับการค้นหาข้อมูล

แบบทดสอบความรู้เกี่ยวกับการค้นหาข้อมูล

5th Grade - University

10 Qs

Python Coding Specialist: Quiz Variables and Data Types

Python Coding Specialist: Quiz Variables and Data Types

9th Grade - University

15 Qs

Understanding Cybersecurity

Understanding Cybersecurity

5th Grade - Professional Development

10 Qs

Python Day 5

Python Day 5

University

15 Qs

Python debugging

Python debugging

University

10 Qs

python dictionary

python dictionary

Assessment

Quiz

Computers

University

Hard

Created by

V. Charles Prabu

Used 18+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Select correct ways to create an empty dictionary

sampleDict = {}

sampleDict = dict()

sampleDict = dict{}

sampleDict = ()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following dictionary operation

dict1 = {"name": "Mike", "salary": 8000}

temp = dict1.get("age")

print(temp)

KeyError: ‘age’

None

3.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Select the all correct way to remove the key ‘marks‘ from a dictionary

student = { "name": "Emma", "class": 9, "marks": 75 }

student.pop(“marks”)

del student[“marks”]

student.popitem()

dict1.remove(“key2”)

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Items are accessed by their position in a dictionary and All the keys in a dictionary must be of the same type.

True

False

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Dictionary keys must be immutable

True

False

6.

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

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

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

d["john"]

40

45

“john”

“peter”

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?