Challenge - 5 Problems
Branching Logic Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of conditional branching in agentic AI decision
What is the output of the following agentic AI decision logic code snippet?
Agentic AI
def agent_decision(score): if score > 80: return 'High priority' elif score > 50: return 'Medium priority' else: return 'Low priority' result = agent_decision(65) print(result)
Attempts:
2 left
💡 Hint
Check which condition the score 65 satisfies in the if-elif-else chain.
✗ Incorrect
The score 65 is greater than 50 but not greater than 80, so the elif branch runs returning 'Medium priority'.
❓ Model Choice
intermediate2:00remaining
Choosing the correct branching model for agentic AI
Which model architecture best supports branching decisions based on multiple conditions in agentic AI?
Attempts:
2 left
💡 Hint
Consider which model naturally splits data based on conditions.
✗ Incorrect
Decision trees split data by branching on conditions, making them ideal for branching logic.
❓ Hyperparameter
advanced2:00remaining
Hyperparameter affecting branching depth in decision trees
Which hyperparameter controls the maximum depth of branching in a decision tree model?
Attempts:
2 left
💡 Hint
This hyperparameter limits how many splits the tree can have from root to leaf.
✗ Incorrect
max_depth limits the number of branching levels in a decision tree.
❓ Metrics
advanced2:00remaining
Metric to evaluate branching decision accuracy
Which metric best measures the accuracy of branching decisions in a classification model?
Attempts:
2 left
💡 Hint
This metric counts correct predictions over total predictions.
✗ Incorrect
Accuracy score measures the proportion of correct classifications, suitable for branching decisions.
🔧 Debug
expert3:00remaining
Debugging incorrect branching in agentic AI code
What error does this agentic AI branching code produce?
```python
def agent_response(value):
match value:
case x if x > 10:
return 'High'
case x if x > 5:
return 'Medium'
case _:
return 'Low'
print(agent_response(7))
```
Agentic AI
def agent_response(value): match value: case x if x > 10: return 'High' case x if x > 5: return 'Medium' case _: return 'Low' print(agent_response(7))
Attempts:
2 left
💡 Hint
Check which case matches value 7 first in the match-case with guards.
✗ Incorrect
7 is not > 10, so first case fails; 7 > 5 is true, so second case returns 'Medium'.