Can I quote a function in return when def a function?


in [this exercise](, task 11 requires me to

“Define a final function called get_work that takes in mass , acceleration , and distance . Work is defined as force multiplied by distance. First, get the force using get_force , then multiply that by distance . Return the result”

so I quoted get_force function when defining get_work and wrote

def get_work(mass,acceleration,distance):
return get_force*distance

the output showed error. since get_force =mass*accelearation, I then wrote:

def get_work(mass,acceleration,distance):
return mass * acceleration * distance

the output showed the correct result—but I don’t quite get why quoting get_force function didn’t work?

Appreciate the answer!

You shouldn’t quote get_force, you should call the get_force function to calculate the force. (may the force be with you :stuck_out_tongue: )