Is it appropriate to send an email to a professor at the end of the semester thanking them for their teaching? I'm aware of very similar questions previously asked - all with good answers. These usually pertain to following up with a professor after a recommendation. My question is specifically about sending a thank you letter to a professor at the end of a semester. 

My current semester is ending in three weeks and it has been my favorite semester by far. My professors taught their material really well and I was engaged non stop from the beginning of the semester. Among my professors, some assigned great homework questions, or lectured really well, or were very accessible during office hours. Overall, I had a great learning experience this semester and I want to express my appreciation because I haven't had a semester like this in the three years I've attended school. 

I understand it may seem silly to question what is just a polite and appreciative gesture (I think it's silly myself), but I'm a little intimidated about the impression it will leave on my professors. I want to avoid the stigma of "teachers pet." For this reason, I've considered writing anonymous notes, but that seems creepy. 

Kind of a light dilemma but I'd like some input because after thinking about it for a while I think it's an interesting topic. Thank you!
In the academic culture I am familiar with, this is a perfectly appropriate and appreciated thing to do after grades have been released. (A letter at the end of the semester but before grades are finalized can look like an attempt to influence the grading process.)

I have received some emails like this, and I was very happy to receive them. They left me with the impression that the student is a mature, appreciative, and thoughtful person, not that he/she is somehow trying to be a "teacher's pet."