Temp conversion – output issues

I have 4 required lines of code and I need to add in the appropriate lines to: Write functions to convert from Fahrenheit to Celsius and vice-versa.

Why I’m posting my question: initial issue of output “none” resolved getting wrong numbers now.

What I believe I understand is happening: I’m trying to print a function that doesn’t have a return statement. So when I use print on the function celsius_to_fahrenheit(100)) its running “correctly” but because of the 4 required lines I have to run the print(celsius_to_fahrenheit(100)) line.

Resources I’ve used prior to adding question: https://beginnersbook.com/2019/05/python-program-to-convert-celsius-to-fahrenheit-and-vice-versa/

https://en.wikipedia.org/wiki/Fahrenheit

What I am getting: 37.77777777777778

What I am expecting: celsius_to_fahrenheit(100) 212.0

Required code: I removed excess spacing

    def fahrenheit_to_celsius(temp):
    def celsius_to_fahrenheit(temp):
    if __name__ == "__main__":
        print(celsius_to_fahrenheit(100))

Resolution to code:

def fahrenheit_to_celsius(temp):
    temp = (temp -32)* 5/9
    return(temp)
def celsius_to_fahrenheit(temp):
    temp = (temp *9/5)+32
    return(temp)
if __name__ == "__main__":
    print(celsius_to_fahrenheit(100))

Answer

This is how you should return from a python function

def fahrenheit_to_celsius(temp):
    temp = (temp *9/5)+32
    return temp
def celsius_to_fahrenheit(temp):
    temp = (temp -32)* 5/9
    return temp
if __name__ == "__main__":
    print(celsius_to_fahrenheit(100))