Dictionary in Python

Dictionary in Python

11th Grade

10 Qs

quiz-placeholder

Similar activities

Python_R

Python_R

2nd Grade - Professional Development

8 Qs

Викторина по Python (Урок 3-4)

Викторина по Python (Урок 3-4)

5th - 11th Grade

10 Qs

Python: списки, кортеж, словник, множина

Python: списки, кортеж, словник, множина

9th - 12th Grade

14 Qs

Dataframe

Dataframe

10th - 12th Grade

12 Qs

PYTHON PROGRAMMING

PYTHON PROGRAMMING

11th - 12th Grade

15 Qs

Python L1 Quiz 4: Lists

Python L1 Quiz 4: Lists

1st - 12th Grade

10 Qs

Python Panda 2

Python Panda 2

11th Grade - Professional Development

10 Qs

Câu lệnh IF

Câu lệnh IF

10th - 12th Grade

15 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?