Question: Consider the following program: def f(bool1, boo12): if (booli and bool2): return 0 elif (booli and (not boo12)): return 1 elif ((not bool1) and

Consider the following program: def f(bool1, boo12): if (booli and bool2): return 0 elif (booli and (not boo12)): return 1 elif ((not bool1) and boo12): return 2 elif ((not booli) and (not bool2)): return 3. Assuming bool1 and boo12 are both boolean variables, which of the following are equivalent to the above program? Select all that apply (zero or more). 1. def f(bool1, boo12): if (booll and boo12): return 0 elif bool1: return 1 elif bool2: return 2 else: return 3 2. def f(bool1, boo12): if (booll and boo12): return 0. if bool1: return 1 if boo12: return 2 else: return 3 3. def f(bool1, boo12): if (booll and boo12): return 0. elif bool1: return 1 elif bool2: return 2 elif (not (bool1 or bool2)): return 3 4. def f(bool1, boo12): if (booll and bool2): return 0 if booli: 5. def f(bool1, bool2): if (bool1 and boo12): return 0 elif (booll or boo12): if bool1: return 1 if boo12: return 2. return 3 return 1 else: return 2 else: return 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
