方寸 Portal

AI Engineer Portal

Your personal operating system for career transition.

Private mode

Exercise

Map provider enums into internal response states

Implement this task with explicit validation, predictable output shape, and enough error handling that it could survive reuse in a real AI workflow.

Python Refresh / easy / Step 6 of 16

Practice stage

Core runtime habits

Hint

Normalize the boundary first, keep return shapes stable, and make the middle of the function boring on purpose.

Success criteria
  • - Returns one stable shape across branches
  • - Makes failure handling obvious
  • - Keeps the core logic readable in under a minute
Review checklist
  • - Did I make the input and output shapes explicit?
  • - Would a teammate know where validation happens?
  • - Did I avoid silent mutation or vague branching?

Practice

Generate a variation

Generate a new exercise variation to deepen understanding or practice a related concept.

Attempt history

Recent submissions

Before you submit, decide what a strong answer should make obvious to the reviewer.

No attempts yet.