9. Let the inequality $\left|2^{x}-a\right|<\left|5-2^{x}\right|$ hold for all $x \in[1,2]$, find the range of real number $a$.

Translate the above text into English, please retain the original text's line breaks and format, and output the translation result directly.
$$
\begin{array}{l}
\text { Since } x \in[1,2] \Rightarrow 5-2^{x}>0 \Rightarrow\left|2^{x}-a\right| 2 ^ { x } - 5 , } \\
{ 2 ^ { x } - a  2 ^ { x + 1 } - 5 }
\end{array} \Rightarrow \left\{\begin{array}{l}
a2^{3}-5=3
\end{array} \Rightarrow 3<a<5,\right.\right.\right.
\end{array}
$$

Therefore, the range of the real number $a$ is $(3,5)$.