I agree....or if the person you bought it from is the 'friend' and it mysteriously came on just before delivery, well, maybe they're not that good of a friend.My guess is the person you bought it from knew the car had issues and just kept clearing the codes so the light wouldn't be lit, until the codes reset themselves after a few times starting and driving the car.
When I bought my first car years ago from a 'friend' he said he would bring it to my house (well how nice, thanks). He dropped it off and left. When I went out to start it the battery was dead. I jumped it a few times but it had to be replaced. He claimed it started 'just fine' and he had never had to jump it. A few weeks later I was visiting his house and his Dad asked me where I had bought a replacement battery. Turned out he had been jumping it for weeks. When I told his Dad he had lied to me he shamed my 'friend' into paying for the replacement. Considering I paid $300 for the car and the battery was about $50 that wasn't too bad (hey, this was in 1982....sure it's a 32 year old story but i'll never forget it).
Moral of the story is.....well.....there isn't one. [offtopic]