Simple Math: Add & Subtract
Python makes math operations simple and powerful. Use the following basic arithmetic operators:
Addition (
+
)Subtraction (
-
)Multiplication (
*
)Division (
/
)
Task
Swipe to start coding
Complete and output the arithmetic operations below
- Add the price of milk (
5.42
) and the price of bread (4.39
). Use+
operator - Subtract the price of all items in the shopping cart (
12.30
) and value of gift card (5.50
). Use-
operator
Requirements checklist
- Check that the sum of 5.42 and 4.39 is printed, allowing for floating point tolerance.
- Check that the result of subtracting 5.50 from 12.30 is printed, allowing for floating point tolerance.
Solution
Everything was clear?
Thanks for your feedback!