The printer is an output device but the scanner which is inside the printer is an input device.
The scanner part of the printer takes the input from the user and sends it to the computer or directly gives output in the form of a texted document/images, etc by printer and printer is an output device because it gives you a printed result of that which you have given a command for printing either by computer or by printer’s control buttons or by any other devices.
So overall, the printer is an output device and the scanner is an input device, the printer is not both input and output device because the scanner is different and the printer is different, they both are different devices. The printer is used for printing, a scanner is used to scan. Nowadays, the scanner comes with the printer jointly and thus can be called as input and output device too.
If a device is putting data into the computer in the form of text, sound, images, button presses, etc. then it is an input device, if the device gives output by getting instructions from the computer such as sound, movement, printing, images, etc., then it is an output device. It really very easy to tell the difference between them, but be remember, some devices can be both input and output!.
Whatever is your answer, you are correct unless your explanation is good.