We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a1256c1 + 82d0b84 commit 2c151faCopy full SHA for 2c151fa
_episodes/08-func.md
@@ -50,7 +50,17 @@ Let's start by defining a function `fahr_to_celsius` that converts temperatures
50
from Fahrenheit to Celsius:
51
52
~~~
53
+def explicit_fahr_to_celsius(temp):
54
+ # Assign the converted value to a variable
55
+ converted = ((temp - 32) * (5/9))
56
+ # Return the value of the new variable
57
+ return converted
58
+
59
def fahr_to_celsius(temp):
60
+ # Return converted value more efficiently using the return
61
+ # function without creating a new variable. This code does
62
+ # the same thing as the previous function but it is more explicit
63
+ # in explaining how the return command works.
64
return ((temp - 32) * (5/9))
65
66
{: .language-python}
0 commit comments