Electric household power is alternating but many common household electrical appliances run on direct current, for this reason there are transformers that lower the voltage and straighten the current to get a DC.
The domestic current changes the polarity, that is, the way it flows 50 times per second (50 Hz Italian standard). ie every 1/50 = 0.02 seconds.
The Ttransformer is a static electric machine (because it does not contain moving parts).
In particular, the transformer allows to vary the input voltage and current parameters with respect to the outputs while maintaining the amount of apparent electrical power.
The transformer is a machine that can only operate in alternating current, because it uses the principles of electromagnetism related to variable flows.