Skip to content
PlayOwl

Coding · Grade 9

Expressions, Variables and Input

Using a bike-share fare calculator, learners evaluate Python expressions with precedence and associativity (including floor division of negatives and right-to-left powers), use augmented and simultaneous assignment, read and convert input, and format output with f-string specifiers. They discover why floating-point arithmetic is approximate and learn practical rules: compare with a tolerance and keep money in integer cents.

  • 4 lessons
  • About 85 minutes
  • Check what you learned: 8 questions
  • Ways to answer: fill in the blanks, choose an answer, put code in order, trace code, type a number and true or false
Try it now (no account) One of the five free starter courses Open in PlayOwl

What learners will discover

  • Evaluate arithmetic expressions using precedence and associativity, including **, //, % and negative operands.
  • Trace augmented, multiple and simultaneous assignment, including swaps.
  • Read and convert input and format output with f-string specifiers such as .2f and thousands separators.
  • Explain floating-point imprecision and choose safe practices: tolerances for comparisons and integers for exact amounts.

Lessons

  1. Expressions and precedence 6 steps3 practiceabout 20 min
  2. Variables and assignment 4 steps2 practiceabout 18 min
  3. Input and formatted output 6 steps4 practiceabout 22 min
  4. Floating-point surprises 5 steps3 practiceabout 20 min
  5. Check what you learned 8 questions at the end

Keep exploring

More 9th grade coding

Guide for grown-ups