maynul67

Calculate Gravitational Force Between Two Objects

Jul 13th, 2021
945
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def grav_force(mass1,mass2,r):
  2.     G = 6.674*10**(-11)
  3.     f = G*mass1*mass2/pow(r,2)
  4.     return f
  5. mass1 = float(input("enter mass1: "))
  6. mass2 = float(input("enter mass2: "))
  7. r = float(input("distance between 2 objects: "))
  8. force = grav_force(mass1,mass2,r)
  9. print("Gravitational force between these objects is: ",force,"N")
  10.    
RAW Paste Data