It is possible to practice piano with an electric keyboard, although it is less effective and may only be suitable for beginners. Keyboards require less of a commitment of money and space than pianos.
A high-quality keyboard is a viable alternative to a piano for practicing beginner players, according to Take Lessons. As piano keys have a certain weight which cannot be replicated by the keyboard, it is preferable to practice on a piano. Digital pianos are the second-best option, followed by a full keyboard with 88 keys and pedals. This would be suitable for 2 to 4 years of beginner-level practice.