Tuple not callable - Course 1 Wk 4 Ex 9

Hi could I please get some help with the following? Thanks in advance!

TypeError Traceback (most recent call last)
in
1 t_AL, t_Y_assess, t_caches = L_model_backward_test_case()
----> 2 grads = L_model_backward(t_AL, t_Y_assess, t_caches)
3
4 print("dA0 = " + str(grads[‘dA0’]))
5 print("dA1 = " + str(grads[‘dA1’]))

in L_model_backward(AL, Y, caches)
58 # grads[“db” + str(l + 1)] = …
59 # YOUR CODE STARTS HERE
—> 60 current_cache = caches(l)
61 dA_prev_temp, dW_temp, db_temp = linear_activation_backward (grads[“dA”+ str(l+1)], current_cache, activation = “relu”)
62 grads[“dA” + str(l)] = dA_prev_temp

TypeError: ‘tuple’ object is not callable

In python, you use square brackets to dereference an array or list. If you use parentheses (), then it thinks you are making a procedure (function) call. That is why that error gets thrown. So if I want to access the 3rd element of a list, tuple or array, the syntax is:

myElement = myTuple[2]

The other point being that indexing is “0 based” in python, which is why the third element has index 2, right? This applies to things like for loops as well. Try running this loop and watch what happens:

for ii in range(1,5):
    print(f"ii = {ii}")

Thank you very much for the guidance! Fixed once I amended to square brackets.