I'm trying to make a program that will output an answer based on the formula for universal gravitation. I am completely new to python so I have no idea what I'm doing. I imagine I must define a function with inputs for each of the 3 variables. But then how do I write it so that the user can input each of the variables to plug into the formula? Also, every time I try to input variables I get "can't multiply sequence by non-int of type 'float'".
What I have right now:
def force(m,M,d):
answer = (G*m*M)/(d**2)
return answer
n= int(input("1: F 2: d 3: m(1 or 2). Solve for: "))
if n==1:
m = input("Enter m: ")
M = input ("Enter M:")
d = input ("Enter d:")
print (force(m,M,d))
G= 6.674*10**(-11)
Please help!