Reference no: EM132356178
Problem
Suppose we have the function foe defined as follows:
def foo(a: int, b: list) -> None: try:
print('A') print(len(b) / a) print('r)
except ZeroDivisionError: print('C')
except:
print('D')
else:
print('E') print('F') #Refer to for part(a)
(a) Why is it a potentially bad design choice to simply have the statement except: as one of the clauses of the function above?
(b) For each function call shown here, write the output that would be printed to the Python console in the box below each call
foo(0, 4)
foo(0, [1,2,3])
foo([1,2,3], 3)
foo(4, [1,2,3])