0

I'm trying to use the 'term' parameter within this function, but PyCharm tells me the parameter 'term' is not used. Is there a special way to do this? Can't seem to find the answer online.

def pinpoint(term, term_to_search):
    count = 0
    for car in car_inventory:
        if car.term == term_to_search:
            print(car)
            count += 1
    if count == 0:
        print("No results found.")
wjandrea
  • 28,235
  • 9
  • 60
  • 81
  • BTW, welcome to Stack Overflow! Check out the [tour], and [How to ask a good question](/help/how-to-ask). This is a decent first question in that it's clear what you're trying to do, but you're focused on the wrong thing. In the future, make a [mre]; in this case if you had tried using this function, you'd see it doesn't actually do what you want. – wjandrea Jun 29 '23 at 23:35
  • I suspect what you want here is `getattr(car, term)`. – Tim Roberts Jun 30 '23 at 00:15

0 Answers0