tutorial |
---|
It is very good practice that all functions return something, even if it is None
.
With what your function returns, you can create algorithms that use multiple functions at the same time.
For example, in this particular case, we have two functions available:
-
dollar_to_euro
: that calculates the value in euros of a given value in dollars. -
euro_to_yen
: calculates the value in yen of a given value in euros.
- Using the two functions available, print on the console the value of 137 dollars in yen.
Working backwards:
-
Our expected value is in yen.
-
Our available function
euro_to_yen
will provide that. -
To get the euros, we will use the available function
dollar_to_euro
.