Computer Science - Informatics Practices Class XI/XII Python Dictionary Solved Test Part 1

Computer Science - Informatics Practices Class XI/XII Python Dictionary Solved Test  Part 1

Q1. Is dictionary in python is a collection or a sequence?

Q2. What do you mean by dictionary in python?

Q3 In dictionary we have _________ value concept.

Q4, In dictionary , key and it's value are separated by ________.

Q5. Entire dictionary is enclosed in _______ braces

Q6. Dictionary is _________(mutable/immutable)

Q7. The ______ of dictionary can be of any type but the _______ must be of immutable type.

Q8. Each key is associated with value.(T/F)

Q9. Write the code to create empty dictionary named 'd'

Q10. Write the output of the following:

            >>> a = {}

            >>>print(type(a))


Solution:

Q1. Is dictionary in python is a collection or a sequence?

Ans : Collection

Q2. What do you mean by dictionary in python?

Ans : Python dictionary is an unordered collection of items where each item is a KEY-VALUE pair

Q3 In dictionary we have _________ value concept.

Ans. Key

Q4, In dictionary , key and it's value are separated by ________.

Ans. colon(:)

Q5. Entire dictionary is enclosed in _______ braces

Ans. Curly -{ }

Q6. Dictionary is _________(mutable/immutable)

Ans. mutable

Q7. The ______ of dictionary can be of any type but the _______ must be of immutable type.

Ans 7- values, key

Q8. Each key is associated with value.(T/F)

Ans. True

Q9. Write the code to create empty dictionary named 'd'

Ans. d={ }

Q10. Write the output of the following:

            >>> a = {}

            >>>print(type(a))

Ans. <class 'dict'>

No comments:

Post a Comment

Most Recently Published

File Handling Test 6

 File Handling Test 6 Q1 . Do we need to use the close() function when we use 'with' statement to open a file? Q2. Which mode you wi...

CS - IP Assignment/Worksheet