Question: Define a function, attendanceCheck, that accepts a string argument corresponding to a day of the week. Using the globally-defined classRoom list, attendanceCheck should return a
Define a function, attendanceCheck, that accepts a string argument corresponding to a day of the week.
Using the globally-defined classRoom list, attendanceCheck should return a new array with only the names of the students present on the inputted day of the week.
classCheck('Monday'); // => ['Marnie', 'Shoshanna'] classCheck('Wednesday'); // => ['Marnie', 'Lena']
"""
classRoom = [ { "Marnie" : [ {"Monday" : True}, {"Tuesday" : True}, {"Wednesday" : True}, {"Thursday" : True}, {"Friday" : True} ] }, { "Lena" : [ {"Monday" : False}, {"Tuesday" : False}, {"Wednesday" : True}, {"Thursday" : False}, {"Friday" : True} ] }, { "Shoshanna" : [ {"Monday" : True}, {"Tuesday" : True}, {"Wednesday" : False}, {"Thursday" : True}, {"Friday" : False} ] }, { "Jessa" : [ {"Monday" : False}, {"Tuesday" : False}, {"Wednesday" : False}, {"Thursday" : False}, {"Friday" : True} ] }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
