Question: PYTHON CODE A minivan has two sliding doors. Each door can be opened by either a dashboard switch, its inside handle, or its outside handle.
PYTHON CODE

A minivan has two sliding doors. Each door can be opened by either a dashboard switch, its inside handle, or its outside handle. However, the inside handles do not work if a child lock switch is activated. In order for the sliding doors to open, the gear shift must be in park, and the master unlock switch must be activated. Your task is to simulate a portion of the control software for the vehicle. The input is a sequence of values for the switches and the gear shift, in the following order: Dashboard switches for left and right sliding door, child lock, and master unlock (O for off or 1 for activated). Inside and outside handles on the left and right sliding doors (0 or 1). The gear shift setting (one of PND 123 R). . A typical input would be 0 0 0 1 0 1 0 0 P. Print 'left door opens' and/or 'right door opens' as appropriate. If neither door opens, print 'both doors stay closed. Make a function door_open() which takes the argument as a string with all the different settings in the same order as above, but without spaces between the numbers. The input is: Left Left Left Right dashboard switch Child lock Master unlock Right inside dashboard switch Gear shift inside handle Right outside handle outside handle 1 handle 1 " 0 0 0 1 0 1 0 0 P" So, the string "00010100P" means "master unlock" and the outside handle on the left door is activated, and that "gear shift is on park. In this case should the left door opens. . The function shall return a list with all the doors that shall opens: [ ] if no door shall open ["left"] if the left door shall open ["right") if the right door shall open ["left", "right") if both doors shall open . . So, if the function gets the string "00010100P" as argument, should it return the list ["left"]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
