Dictionary in Python

Dictionary in Python

11th Grade

10 Qs

quiz-placeholder

Similar activities

Basic Python Coding

Basic Python Coding

11th - 12th Grade

15 Qs

Intermediate python

Intermediate python

9th - 12th Grade

9 Qs

Dataframe

Dataframe

10th - 12th Grade

12 Qs

list in python

list in python

10th - 12th Grade

15 Qs

computer science

computer science

11th Grade

13 Qs

Python Fundamentals -2

Python Fundamentals -2

11th - 12th Grade

10 Qs

String Quiz

String Quiz

9th - 12th Grade

15 Qs

Python Generators

Python Generators

10th Grade - University

10 Qs

Dictionary in Python

Dictionary in Python

Assessment

Quiz

Computers

11th Grade

Hard

Created by

Sangeetha John

Used 11+ times

FREE Resource

10 questions

Show all answers

1.

FILL IN THE BLANK QUESTION

1 min • 1 pt

What will be the output of following code-

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

for i in a:

print(i,end=" ")

2.

FILL IN THE BLANK QUESTION

2 mins • 1 pt

What will be the output of following code-

a={i: i*i for i in range(6)}

a

3.

FILL IN THE BLANK QUESTION

1 min • 1 pt

a={}

a[2]=1

a[1]=[2,3,4]

print(a[1][1])

4.

FILL IN THE BLANK QUESTION

1 min • 1 pt

What will be the output of following program:

dictionary = {1:'1', 2:'2', 3:'3'}

del dictionary[1]

dictionary[1] = '10'

del dictionary[2]

print(len(dictionary))

5.

FILL IN THE BLANK QUESTION

2 mins • 1 pt

What will be the output of following program:

a={1:5,2:3,3:4}

a.pop(3)

print(a)

6.

FILL IN THE BLANK QUESTION

1 min • 1 pt

What will be the output of following program:

my_dict = {}

my_dict[(1,2,4)] = 8

my_dict[(4,2,1)] = 10

my_dict[(1,2)] = 12

sum = 0

for k in my_dict:

sum += my_dict[k]

print (sum)

7.

FILL IN THE BLANK QUESTION

1 min • 1 pt

What will be the output of following program:

a = {(1,2):1,(2,3):2}

print(a[1,2])

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?