Bird
0
0

Consider this pseudocode for an AGI agent updating its knowledge:

medium📝 Predict Output Q13 of 15
Agentic AI - Future of AI Agents
Consider this pseudocode for an AGI agent updating its knowledge:
knowledge = {"facts": 10}
new_info = 5
knowledge["facts"] += new_info
print(knowledge["facts"])
What will be the output?
ATypeError
B10
C5
D15
Step-by-Step Solution
Solution:
  1. Step 1: Understand dictionary update

    The dictionary key "facts" starts at 10, then 5 is added to it.
  2. Step 2: Calculate the new value

    10 + 5 = 15, so printing knowledge["facts"] outputs 15.
  3. Final Answer:

    15 -> Option D
  4. Quick Check:

    10 + 5 = 15 [OK]
Quick Trick: Add values inside dictionary keys correctly [OK]
Common Mistakes:
  • Thinking print shows old value
  • Confusing key access syntax
  • Expecting error from adding integers

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Agentic AI Quizzes