adplus-dvertising
frame-decoration

Question

Which of the following statements create a dictionary?

a.

d = {}

b.

d = {“john”:40, “peter”:45}

c.

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

d.

All of the mentioned

Answer: (d).All of the mentioned

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which of the following statements create a dictionary?

Similar Questions

Discover Related MCQs

Q. Suppose d = {“john”:40, “peter”:45}, to delete the entry for “john” what command do we use

Q. Suppose d = {“john”:40, “peter”:45}. To obtain the number of entries in dictionary which command do we use?

Q. Suppose d = {“john”:40, “peter”:45}, what happens when we try to retrieve a value using the expression d[“susan”]?

Q. Which of these about a dictionary is false?

Q. Which of the following is not a declaration of the dictionary?

Q. Which of the following isn’t true about dictionary keys?

Q. Which of the statements about dictionary values if false?

Q. If a is a dictionary with some key-value pairs, what does a.popitem() do?

Q. Which of the following functions is a built-in function in python?

Q. The function pow(x,y,z) is evaluated as:

Q. What is the output of the function complex() ?

Q. The function divmod(a,b), where both ‘a’ and ‘b’ are integers is evaluated as:

Q. Which of the following functions accepts only integers as arguments?

Q. Suppose there is a list such that: l=[2,3,4].
If we want to print this list in reverse order, which of the following methods should be used?

Q. Which of the following is the use of function in python?

Q. Which keyword is use for function?

Q. Which are the advantages of functions in python?

Q. What are the two main types of functions?

Q. Where is function defined?

Q. What is called when a function is defined inside a class?