In a word, yes. Law schools are interested in learning what kind of a law student you will be. Letters that address your intellectual abilities are the ones which are most helpful to admission committees. Typically, letters from faculty members are the most informative and useful kinds an applicant can provide. In that case, it is important that the faculty member describe the work done in the course in some detail, even though the faculty member may not remember you except as a name in a grade book.
Professors often serve as recommenders for a number of students in any given semester.
When you ask a professor to write for you, then be sure to provide as much information as possible in order to make their job easier. Professors often like to meet with students for a few minutes to reacquaint themselves with the person, to find out more about other things the student has done while at IU, and why the student is applying to law school. They may ask you for a transcript, a resume or short memo about your other accomplishments, a copy of a paper or project you did in that class, or a recent writing sample. Gather this information before you ask the professor to write for you. Most letters from politicians only reflect the fact that you and your family are constituents whose votes the politician would like to keep.