AI for Everyone - What is Artificial Intelligence
This code tries to use a rule-based system but has a bug:
What is the bug and how to fix it?
rules = {'hot': 'turn_on_ac', 'cold': 'turn_on_heater'}
def apply_rule(temp):
if temp > 25:
return rules['hot']
elif temp <= 25:
return rules['cold']
print(apply_rule(25))What is the bug and how to fix it?
