Step 1 of 30
Time Remaining30:00

Topic: Multiplication & Subtraction Precedence

1 / 30

You are building a checkout system for an online store. A customer has a cart worth 200200.

You want to apply a $10 discount and then apply a 5% tax (0.05) only to the remaining balance.

An entry-level developer writes the following code:

total = 200 - 10 * 1.05

Problem: This code does not give the correct result because of operator precedence.

What is the actual result Python will calculate, and why is it wrong for this business logic?

Your Answer

Select the best option below.

199.5; It is wrong because Python multiplied 10 by 1.05 before subtracting from 200.
189.0; It is wrong because Python subtracted 10 from 200 first.
210.0; It is wrong because the tax was added to the discount.
190.5; It is wrong because Python performed the operations from left to right.

Review your choice before proceeding.