I bought an Olympus voice recorder for this a year or two ago and it’s been perfect for my needs. The sound quality is ok but not great. Perfectly fine for playing back to yourself or to record your teacher playing. I went for Olympus because it’s not tied into Windows (like Sony and others) – it just connects as a USB drive and you can copy files over. I also use it as a USB portable storage drive.
A friend of mine has a Zoom recorder and the sound quality is excellent – much better than from my Olympus. However, it was about 3 times the cost…