...

/

Solution Review: Gravitational Force

Solution Review: Gravitational Force

Review the solution for the "Gravitational Force" exercise.

We'll cover the following...

Solution

Let’s explore the solution to the problem of calculating gravitational force.

Press + to interact
G = 6.67 * (10 ** -11)
M = 6.0 * (10 ** 24)
m = 7.34 * (10 ** 22)
r = 3.84 * (10 ** 8)
grav_force = (G * M * m) / (r * r)
print(grav_force)

Explanation

Here’s a line-by-line explanation of the code that calculates the gravitational force between two masses:

    ...