Showing posts with the label Dictionaries

Complete the following code and predict the output:

Q. Complete the following code and predict the output: # Data to count. names =…

Assume that price_dict is Python variable to which dictionary literal has already been assigned

Q. Assume that price_dict is a Python variable to which a dictionary literal ha…

True / False For Dictionaries Class 11 CS, IP

True / False For Dictionaries Class 11 Computer Science (CS), Informatics Pract…

Fill In the Blanks For Dictionaries Class 11 CS, IP

Fill In the Blanks For Dictionaries Class 11 Computer Science (CS), Informatics…

MCQ For Dictionaries Class 11 CS, IP

Multiple Choice Question For Dictionaries Class 11 Computer Science (CS), Infor…

Write a Python program that accepts a value and checks whether the inputted value is part of given dictionary or not.

Q. Write a Python program that accepts a value and checks whether the inputted …

Predict the output: (a) d = {(1, 2):1, (2, 3):2} print (d[1, 2])

Q. Predict the output: (a) d = {(1, 2):1, (2, 3):2} print (d[1, 2]) (b) d = {&#…

What will be the output of the following code: d1 = {5: [6, 7, 8], a: (1, 2, 3)} print (d1.keys ())

Q. What will be the output of the following code: d1 = {5: [6, 7, 8], "a&q…

The following code is giving some error. Find out the error and write the corrected code.

Q. The following code is giving some error. Find out the error and write the co…

Suppose d1 = {1: one, 2: two, 3: three, 4: four} d2 = {5: five, 6: six}

Q. Suppose >>>d1 = {1: 'one', 2: 'two', 3: 'three&…

Find errors and rewrite the same after correcting the following code: (a) d1 = {1:10, 2.5:20, 3:30, 4:40, 5:50, 6:60, 7,70}

Q. Find errors and rewrite the same after correcting the following code: (a) d1…

What are the differences between strings and dictionary?

Q. What are the differences between strings and dictionary? Answer:- The dictio…

What is a key-value pair in dictionary?

Q. What is a key-value pair in dictionary? Answer:- Dictionaries are simply ano…

A dictionary has three keys: assets, liabilities and capital.

Q. A dictionary has three keys: 'assets', 'liabilities' and …

Discuss the working of copy() if.

Q. Discuss the working of copy() if (i) The values are of immutable types, (ii)…

What is the use of copy() function?

Q. What is the use of copy() function? Answer = The copy() method is used  retu…

What do you understand by shallow copy of a dictionary?

Q. What do you understand by shallow copy of a dictionary? Answer = A shallow c…

Can you use sum() for calculating the sum of the values of a dictionary?

Q. Can you use sum() for calculating the sum of the values of a dictionary? Ans…

Will max() and min() always work for a dictionary?

Q. Will max() and min() always work for a dictionary? Answer = Yes, if the dict…

If sorted() is applied on a dictionary, what does it return?

Q. If sorted() is applied on a dictionary, what does it return? Answer = If onl…

Load More That is All