QUESTION IMAGE
Question
question # 5
dropdown
complete the code.
a sample member of the list data is a1 = male, true where the second item is true if the person is on the phone.
for item in data:
if item0 == male:
males = males + 1
if item :
malesonphone = malesonphone + 1
Step1: Analyze the data structure
Each element in the list data is a list with two items. The first item is a string representing gender and the second is a boolean indicating phone - usage.
Step2: Determine the index for phone - usage check
Since the boolean value for phone - usage is the second item in each sub - list, the index is 1.
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
1