Agentic AI - Future of AI Agents
This code tries to update an agent's knowledge but has a bug:
actions = ['jump', 'run']
results = [True, False]
knowledge = {'jump': 0.3, 'run': 0.7}
for i in range(len(actions)):
if results[i]:
knowledge[actions[i]] += 0.1
else:
knowledge[actions[i]] =- 0.1
print(knowledge)
What is the bug and how to fix it?