Question 1: Which of the following statements is true?
Question 2: Which of following objects is not a valid declaration for dictionary?
Question 3: To delete a key value pair in dictionary, use _______.
Question 4: The items()
method of dictionary returns ______.
Question 5: What will be the output of the following code?
nums = {"ONE":1, "TWO":2}
print(nums["One"])
Question 6: years={1995:'Java', 1972:'C', 1994:'Python'}
is a dictionary with key-value pairs of the year of invention and name of a language. The expression list(years)
will return ____________.
Question 7: What will be the output of the following code?
years={1995:'Java', 1972:'C', 1994:'Python'}
print(years.get(2000))