Intermittent failure of certain keys to respond
If you have this problem, prepare yourself for a long session of searches and partial answers. I wish Apple would summarize all the different possibilities in one page.

In my case, out went the "p" and then the ENTER key. (Survival trick: use the Keyboard Viewer to enter ENTER or any other key. If you are logged out I was not able to figure out how to enter "p" in my password using and ALT-### format ...).

So ... I did all the recommended resets (PRAM,SMC,safe mode reboot,upgrading to High Sierra). I checked that no System Settings were incorrect, added other language keyboards, upgraded to High Sierra. 

Finally, I decided to risk going with the tools for the first time into my keyboard, removed and cleaned the "p" with help of this YouTube video, the best among many I saw. (Note not all keys are created equal and that several articles say the control keys —SPACE, ENTER, SHIFT, ALT, OPTION— are harder to put back in as they have a pin). 

And ... nothing. 

One article (which I cannot find now) had very useful pictures of the transparent film under the keys, which explains why keys that are in the same row tend to fail together. This film has gold conductive paint that follows a horizontal serial path on one side, so if there is corrosion or a mechanical problem in one key, it is likely to affect (or start affecting) keys in the same row, like when a bulb fails in a Christmas light with only two cables.

As the problem is intermittent, I discovered by chance that closing the lid, and putting the laptop vertically and putting pressure on both ends fixes the "p" and ENTER problems temporarily. I think my problem is the battery, which is 2-3 years old and at some point I've read that they start swelling.