Function problem

hello for everybody, my apologize if i not write something very good but i can not find answer at this question, why at answer is not a int. number but is this <function get_force at 0x7f0b93832e18>.
I try to find any answer but all is with syntax errore and i can not understand why its work if answer is not correctly???

Uncomment this when you reach the “Use the Force” section

train_mass = 22680

train_acceleration = 10

train_distance = 100

bomb_mass = 1

def get_force(train_mass, train_acceleration):

return train_mass * train_acceleration

get_force(22680, 10)


get_force is the name of the function.
get_force(22680, 10) calls this function with two arguments. A value is returned by the function, but you neither printed this result nor assigned it to a variable.
print(get_force) is not calling the function. Since no call was made, so no value will be returned. It simply prints information about where the function is stored in memory.

// You can print the result of the function call directly
print(get_force(22680, 10)) 

// or you could save the result in a variable and then print it
result = get_force(22680, 10)

// doesn't call the function. Only prints a string representation of information 
// about the function. 

1 Like

Thanks you very much

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.