As you all know $$\tan(x)=\frac{\cos(x)}{\sin(x)}$$so, $$\cos(x)\cdot \tan(x)=\sin(x)$$ $\sin\left(\dfrac{\pi}{2}\right)=1$ and $\cos\left(\dfrac{\pi}{2}\right)=0$ also $\tan\left(\dfrac{\pi}{2}\right)=\text{undefined}$
However $\tan\left(\dfrac{\pi}{2}\right)$ is not equal but is undefined because it is $\dfrac{1}{0}$ so does that mean $\dfrac{1}{0} \cdot 0=1$ in this case?
$\dfrac 10=\text{undefined}$
And you can never divide by $0$ and/or work with undefined numbers (why even call them numbers if they are undefined).
In this case, $0$ and $0$ do not "cancel each other out".
If you can argue that $\dfrac 10\cdot0=1$, then another person can pose an argument that $\dfrac10\cdot0=0$.
Therefore, it is senseless to define such an expression. $\tan\left(\dfrac{\pi}2\right)$ is undefined in mathematical terms.