Real pianos are great but the one big drawback is you can’t turn the volume down so with a piano you tend to end up playing for the neighbors. With a keyboard you can stick on some headphones and play whatever turns you on – you can experiment, make mistakes and sound silly and play something a thousand times without driving other people nuts. Ideally – have BOTH!
If you are buying a piano it is preferable to buy an overstrung piano not a straight strung! How to tell: Lift the top lid of the piano you should see the tuning pins at the top of the piano. If the tuning pins are evenly spaced along the pin block and the strings are all parallel and vertical this is a straight strung piano. If there is a group of tuning pins at the left and a separate group at the right and the strings cross over in a X shape this is an overstrung piano. Also get a tuner to check it out. I bought a piano once that needed to have the wood treated because all the pins (that tighten the strings) were coming loose very quickly after being tuned – disaster!