This course is about JavaScript’s numbers next to Python’s: dividing, rounding, reading them from text, and formatting them. JavaScript arithmetic rarely stops with an error, so a port that looks right can print the wrong number. Along the way, you’ll port a coffee roastery’s Python batch planner.
Here’s a first taste. The planner counts the full 12 kg batches the drum takes. These are its batch lines in Python:
WEIGHT_LOSS = 0.15
DRUM_KG = 12
order_kg = 37.5
green_kg = order_kg / (1 - WEIGHT_LOSS)
full_batches = int(green_kg // DRUM_KG)
print(f"Batches: {full_batches} full")
Python prints three full batches:
Batches: 3 full