How to do :
- Take input of masses of the body of same unit .
- Take input of distance between two bodies.
- calculate the gravitational force between them by the expression (f=G*m1*m2/d*d)
m1=float(input("Enter the mass of first body: "))
m2=float(input("Enter the mass of second body: "))
r=float(input("Enter the distance between of the masses: "))
print("Required gravitational force is: ",f,"N")
- Program take input of masses and distance between the bodies.
- Program calculate the gravitational forces between the bodies.
- Program print the result.