Which of the following is correct with respect to following Python code?
d = {"a”: 3, “b”: 7}
a) a dictionary d is created.
b) a and b are the keys of dictionary d
c) 3 and 7 are the values of dictionary d.
d) All of these.
Answers
Answer:
ALL OF THESE
I HELP YOU BRALIANT ANSWER
All of these are correct with respect to following Python códe.
d) All of these
Extra Information
Dictionary in Python is used to store data values in an unordered collection. For storing data in a dictionary keys are used. It's like a key: value pair in which data is held by unique keys.
In the códe d = {"a”: 3, “b”: 7}
d is a dictionary that has keys a and b and its values are 3 and 7 respectively.
Example
d1 = {"abc":5,"def":6,"ghi":7}
d1 is a dictionary that has keys abc, def, and ghi and its values are 5, 6, and 7 respectively.
Python is created by Guido van Rossum and came into existence in 1991. It is a high-level and general programming language. It is a very lucid programming language as it has a good language construct and object-oriented approach. It is dynamically typed and garbage-collected.