Repairing a squared-unit conversion

A function should return tensile stress in megapascals from force in newtons and area in square millimetres:


Python
def stress_mpa(force_n, area_mm2):
    area_m2 = area_mm2 * 1e-3
    stress_pa = force_n / area_m2
    return stress_pa / 1e6


Use σ=F/A\sigma=F/A. For a force of 7500 N7500\ \text{N} and an area of 400 mm2400\ \text{mm}^2, determine the result the function should return after correcting its unit conversion. Give your answer in MPa, to two decimal places.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Software Debugging Questions: