Im working on Getting ready for physics class and I am having a little trouble understanding Return

link to the project

def f_to_c(f_temp):
  return (f_temp - 32) * 5/9 


f_to_c(100)
print(f_to_c(100))

When I call the function, why is the output blank? Why do I have to print the function call out for it to give me any output? Am I using return wrong?

No, you are not using the return statement wrong. Your code works as expected.

The return statement simply sends back the return value to the line the function was called from. If you want to get the value as an output you have to use the print function.

1 Like

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