Is it appropriate to send an email to a professor at the end of the semester thanking them for their teaching?
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."