Refresh everyday arithmetic with small programming examples. No advanced math or previous coding experience required. Optional support only—not a prerequisite for exams or certificates.
Recognize that 1/4, 0.25 and 25% describe the same share of a whole.
Divide the part by the whole, then multiply by 100.
Use parentheses to make the intended calculation explicit.
If 3 of 4 tasks are complete, your fraction is 3/4. Divide 3 by 4 to get 0.75; multiply by 100 to get 75%. The denominator is the whole, so it cannot be zero.
completed = 3
total = 4
share = completed / total
print(share) # 0.75
print(share * 100) # 75.0The symbols +, -, * and / mean add, subtract, multiply and divide. Python uses ** for a power, not ^. Multiplication and division happen before addition and subtraction; parentheses happen first.
print(2 + 3 * 4) # 14
print((2 + 3) * 4) # 20
print(2 ** 3) # 8Moving from 60% to 75% is an increase of 15 percentage points. Relative to the original 60, that is a 25% increase: (75 - 60) / 60 × 100. These describe different comparisons.
old = 60
new = 75
print(new - old) # 15 percentage points
print((new - old) / old * 100) # 25 percent increaseAlways name the unit and the whole. A model getting 18 of 20 examples right has 90% accuracy on those examples, not a promise of 90% accuracy everywhere.
When this helps: Use this refresher for progress indicators, discounts and simple evaluation reports in Foundations.
completed = 8 total = 10 # Calculate percentage and remaining tasks # Print each result on its own line
Test your understanding with this quiz. Select the best answer for each question.
Help optimize our AI programming lessons to ensure student success!
Sign in to send a comment to Customer Support.