How to understand the step(Z1) in the equation of partial derivation given W1 and b1, and how to correctly implement it in python?

step(Z_1) is a step function evaluating on Z_1. That means if Z_1 < 0, then
step(Z_1)=0, else 1.
In assignment we make W_2^T(\hat{Y}-Y) = 0 if Z_1 < 0. In Python, this has already been done for you in the line l1[z1 < 0] = 0. So you don’t have to worry about implementing step function.

Hope that helps.