Is learning piano on a keyboard just as effective as learning on a grand/upright piano?

Since the layout of keys for both electronic keyboards and pianos are the same, keyboards could be effective for beginners. However, Pianos have more “action” than keyboards (i.e. how the keys feel when pushed down, whether they are light or heavy).  So learning on a keyboard may not prepare a person for the heavier feeling of piano keys. If a piano is too costly or large, another option is learning on a keyboard with weighted keys that feel much more similar to a piano.