Which teacher should I ask to write me a rec letter?

Teacher A, who taught me for only 1 semester in 10th grade, but in whose class I was very active and engaged (we communicate occasionally now), or Teacher B, who has taught me for junior + 1st semester of senior year, but who I’m not close with?

The reason why was because I preferred the subject Teacher A taught.
I did equally well in both classes.

When I was looking for recommendation letters, I was given two general guidelines: i.e, make sure one’s from a humanities field and one’s from a STEM field, and that they both know you on a level that’s personal enough that they can write about your character.
The goal is to get someone who’s effusive about you in their rec, someone who can positively claim that you were the best student they ever had. Both of the teachers I chose only taught me for a semester. One was a nanotechnology professor whose class I was dual-enrolled in. He got me really interested in engineering, and I spent a lot of time researching current applications of the stuff we learned, and making sure the rest of the class got my very detailed notes. I think he hinted that I should ask him for a recommendation letter a couple of weeks before junior year ended and promised a really strong letter.
I chose my creative writing teacher for my “humanities” recommendation. She had me in her class when I had just moved in from another country and was befuddled and friendless. She watched me grow as a writer. By the end of the year, my writing was much more vivid and I had experiment with several different styles. I think she uses one of the last pieces I wrote for her class as an example for her current students. At the same time, she saw me become more confident on a personal level.
To be honest, I second-guessed myself several times. I wanted to get letters from my “core subjects” because nanotechnology was not my main science class that year (that dubious honor goes to AP Biology) and creative writing isn’t exactly considered rigorous (I put more time into it, but our course catalog says that expected hw is about 30 minutes per class and more when something needs to be turned in). Ultimately, I decided that
more interaction with a teacher + them being able to speak to me on a personal level > the recommendations you’re supposed to get

Of course, since I’m a high school senior like you, you should take my advice with a grain of salt. But I would go ahead and get that recommendation from Teacher A, especially if you want to pursue a major related to it.

Many institutions require that the teacher recommendation be from a junior or senior teacher. Check the policy.

I second @anxioussenior1, most schools will only look at junior and senior recs, when you’ve been taking advanced classes and are closer in development to where you’ll be in college.

Seems like junior-senior teacher letters are suggested, but not required, for the schools I’m looking into (Yale and UChicago).

I may end up asking both… hopefully they’ll balance each other out? Haha.