What is the best approach to writing a program that can select a matching element from a dataset (Objects or JSON or Dictionaries)?
I'm having trouble making the search generic or I just have to use lots of conditions to check what input I give.
An example:
{
model: Volvo
engine: gas
price: 100
}{
model: Tesla
engine: Electric
price: 200
}
I need to search based on different conditions:
- model = Volvo
- engine = Electric AND price < 300
I have a problem with the AND case and the different mathematical conditional expressions. Do I need to make an e.g. react + firebase app? Or can you make a quick python script with console input without lots of match/if statements?