Answer
$x=4$
Work Step by Step
Note that:
$\frac{1}{27}=\frac{1}{3^3}=3^{-3}$
Write $\frac{1}{27}$ as $3^{-3}$ to obtain:
$3^{1-x}=3^{-3}$
RECALL:
If $a^x = a^y$, then $x=y$.
Use the rule above to obtain:
$\begin{array}{cccc}
\\&3^{1-x}&=&3^{-3}
\\&1-x&=&-3
\\&-x&=&-3-1
\\&-x&=&-4
\\&-1(-x)&=&-4(-1)
\\&x&=&4\end{array}$