I have a series of rules that I want to be able to execute without having to manually edit the code. I'd like to give my rule conditions at the beginning and have the program run it. This way, I can test every single rule combination in a for loop as well.
Here is a visual example of what I'm trying to do:
firstlist = ["Eat","Chew","Both"] secondlist = ["Swallow","Spit","None"] thirdlist = ["Punch","Kick","Push"] if firstitem == "Eat": foodvalue = 4 if seconditem == "swallow": secondfood = 9 if thirditem = "Kick": losecalories = 6 output = foodvalue - secondfood + losecalories
The rules interact with each other so that the output depends on the combination of those rules. Is there any way I can make this dynamic? So that I can have one generic function that will translate all my inputs into one output no matter what I use?