Question: It says that the except is an invalid syntax for this code: import pdb def func 1 ( a , b ) : return (

It says that the except is an invalid syntax for this code: import pdb
def func1(a, b):
return (a + b)/(a - b)
def func2(size):
digits = np.random.randint(0,9, size=size)
for i in range(digits.size -1):
a = int(digits[i])
b = int(digits[i +1])
try:
ans = func1(a, b)
except ZeroDivisionError:
pdb.set_trace()
break
func2(1000)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!