diff --git a/physics/Einstein's Energy-Mass Equivalence.py b/physics/Einstein's Energy-Mass Equivalence.py new file mode 100644 index 000000000000..766cbf5a8c54 --- /dev/null +++ b/physics/Einstein's Energy-Mass Equivalence.py @@ -0,0 +1,19 @@ +c = 299792458 + + +def energy_equivalence(mass_kg): + # Check if the mass is non-negative + if mass < 0: + raise ValueError("mass should be positive") + + # Check if the speed of light is positive + if c <= 0: + raise ValueError("Speed of light must be positive") + + # Calculate energy using the mass-energy equivalence equation + energy = mass * c**2 + return energy + + +if __name__ == "__main__": + energy_equivalence()