Which of the following contains the proper Python syntax for defining a dictionary?
A) fruitPrices = ['bananas' : 1.00, 'apples' : 1.50, 'pears' : 2.00]
B) fruitPrices = {'bananas' : 1.00, 'apples' : 1.50, 'pears' : 2.00}
C) monthlyIncome = [['March', 2000], ['April', 2300], ['May', 1900]]
D) firstFiveInts = {1, 2, 3, 4, 5}
E) None of the above
Correct Answer:
Verified
Q2: The location that an element is stored
Q3: The dictionary type in Python is an
Q4: The dictionary type in Python is of
Q5: A dictionary may be contained within another
Q6: Dictionaries in Python are
A) mutable
B) immutable
C) neither
Q8: Which of the following CANNOT be used
Q9: Which of the following is NOT valid
Q10: The values stored in a dictionary are
Q11: The location that a given value is
Q12: Three example of the types of values
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents