QUESTION IMAGE
Question
if you call the type() function on the object grocery, what will be the output?
grocery = sugar, meat, eggplant, apples, bread
type(grocery) is <class list>
question 3
2 pts
write code to extract the third element in the grocery object.
question 4
2 pts
the following 4 (four) questions relate to a python code you will create.
write python code to create an empty dictionary named food
Question 3
Step1: Indexing in Python
In Python, list indexing starts from 0. So the third element has an index of 2.
grocery[2]
Question 4
Step1: Creating an empty dictionary
In Python, an empty dictionary can be created using {} or the dict() constructor.
food = {}
or
food = dict()Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
For Question 3: grocery[2]
For Question 4: food = {} or food = dict()