Tuple values - Don't understand what this line of code does

Hello
The following code is from the assignment, not the answer
It from the assignment " Building your Deep Neural Network: Step by Step"

Exercise 8

I try to understand the following line:

linear_cache, activation_cache = cache

So I add another cell bellow and try to re-run the test

print(t_linear_activation_cache)

linear_cache, activation_cache = t_linear_activation_cache
print("This is linear_cache: ----")
print(linear_cache)
print("This is activation_cache: ----")
print(activation_cache)

The testing variable “t_linear_activation_cache” is tuple format
I don’t understand how the two varaibles:

  • linear_cache
  • activation_cache
    get the result
((array([[-2.1361961 ,  1.64027081],
       [-1.79343559, -0.84174737],
       [ 0.50288142, -1.24528809]]), array([[-1.05795222, -0.90900761,  0.55145404]]), array([[2.29220801]])), array([[ 0.04153939, -1.11792545]]))
This is linear_cache: ----
(array([[-2.1361961 ,  1.64027081],
       [-1.79343559, -0.84174737],
       [ 0.50288142, -1.24528809]]), array([[-1.05795222, -0.90900761,  0.55145404]]), array([[2.29220801]]))
This is activation_cache: ----
[[ 0.04153939 -1.11792545]]

I read some introduction of python about tuple but still do not get how it ends up with the result above
Thank you
Phan

Try something simpler:

arr = [10, 20]
a, b = arr
print(a, b)