Explanation
Yes. Both descriptions fit an acoustic piano. Calling it a string instrument tells you what vibrates. Calling it a percussion instrument tells you how that vibration starts.
Press a key and a felt-covered hammer strikes one or more strings. Their vibrations travel to the wooden soundboard, which makes the note much louder than the strings would sound on their own.
The word “acoustic” matters here. A digital piano can have weighted keys and even a hammer mechanism to recreate the touch of an acoustic piano while generating the note electronically.
Key takeaway
Follow one keystroke inside an acoustic piano and you can see both families at work: a hammer strikes, then strings vibrate.