Free practice · ordering · medium

Practice

Review a typed expression

Order the reasoning steps for reviewing an expression that uses user input.

Typed expression trace

Every value has a type before an operator uses it

Source
Raw value and its current type
Contract
Allowed type, format, and range
Conversion
Explicit and failure-aware
Expression
Operators applied by precedence
Evidence
Resulting value and type

Track the source value, current type, conversion boundary, evaluation order, and resulting type instead of relying on how a value looks.

Arrange in the correct order
  1. 1. Compare the result with the required output contract
  2. 2. Record the resulting value and type
  3. 3. Apply operators in Python precedence order
  4. 4. Identify each input value and current type