Functions in python 3
<p>I'm struggling with functions in python 3. How can I make the below code print out the result in degrees Celsius? Is the indentation wrong, or has it to do with me not defining Celsius outside the function in the first place? Does this mean I do not have to use functions for simple tasks or is it better to do so anyway?</p>

<pre><code>print ("Welkom bij mijn Fahrenheit naar Celsius converteerprogramma!")

fahrenheit = int(input("Voer aantal graden Fahrenheit in "))

def converter_fahrenheit(fahrenheit):
    celsius = (fahrenheit - 32) * 5/9
print (fahrenheit, "graden Fahrenheit is omgerekend ","%.2f" % celsius,"graden Celsius")
</code></pre>

<p>Quite a few changes needed, yes you had the indentation wrong for the print statement. But that's not all see how the code is ordered now</p>

<pre><code>def converter_fahrenheit(fahrenheit):
    celsius = (fahrenheit - 32) * 5/9
    print (fahrenheit, "graden Fahrenheit is omgerekend ","%.2f" % celsius,"graden Celsius")

print ("Welkom bij mijn Fahrenheit naar Celsius converteerprogramma!")

fahrenheit = int(input("Voer aantal graden Fahrenheit in "))
converter_fahrenheit(fahrenheit)
</code></pre>

<p>Defining the function first, makes it possible for you to actually call the function without an error being thrown. Yes, you were not calling the function at all!</p>

python