Bird
0
0

What will be printed by this code simulating a self-improving agent's score update?

medium📝 Predict Output Q5 of 15
Agentic AI - Future of AI Agents
What will be printed by this code simulating a self-improving agent's score update?
score = 10
improvement = 2
score = score + improvement
improvement = improvement / 2
score = score + improvement
print(score)
A12.0
B14.0
C13.0
D15.0
Step-by-Step Solution
Solution:
  1. Step 1: Perform first update

    score = 10 + 2 = 12
  2. Step 2: Update improvement and perform second addition

    improvement = 2 / 2 = 1.0; score = 12 + 1.0 = 13.0
  3. Final Answer:

    13.0 -> Option C
  4. Quick Check:

    Score after updates = 13.0 [OK]
Quick Trick: Add improvements stepwise, update improvement before next add [OK]
Common Mistakes:
  • Adding improvement twice without updating
  • Dividing improvement after adding second time
  • Misreading variable updates

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Agentic AI Quizzes