Skip to main content
Pick the right tax formula for an income with an if, elif, else chain ordered from the highest bracket down, and round the tax to two decimals. Open Lab 8 in the IP Lab Portal

What you will practice

  • Build an if, elif, else chain
  • Order the conditions from highest to lowest
  • Round the result to two decimals

Before you start

Time

25 minutes

Where

IP Lab Portal

Module

Module 4: Conditional execution

  • In the IP Lab Portal, open Lab 8 - Income tax calculator.
  • In class, this lab comes right after the Lesson 4 recap slide in Module 4 core material.