This is my opinion, though there are few ways to look at it.
Piano is great the feel of it and the sound I would say is more natural in comparison to keyboards. As much as how the newer keyboards emulate the piano in tone and pitch, the feeling is just not the same.
Moreover I guess some of the keyboards have quite a limited range in terms of octaves , but depending on what type of music genre or style you would like to play this could also work to your advantage, moreso the portability of carrying a keyboard around.
If you intend to want to experiment or play around with a number of synthesised instruments, then a keyboard is great to synthesize those digital instrument sounds , unlike a piano which is.. well just a piano

Then again cost wise is also a huge factor considering a piano can be a hefty investment compared to a keyboard. Nonetheless if your doing it as a hobby most likely keyboard is a better pick.
Moreso on a plus side I guess though this comes later keyboards these days can be plugged in for digital mixing.. if you are to get into that kind of thing. Classic pianos will be harder.. unless your looking more into an electric piano.. but that again is a whole new topic
Sorry for being so long, hope you have fun playing music.