Jan-31-2018, 09:24 PM
You are on the right track. The thing is, your function is returning a value, which can be used outside of the function but you need to have a variable to hold that value so that you can utilize it, say in a 'print()' function.
For example:
For example:
def sums(num1, num2): total = num1 + num2 return total answer = sums(5, 5) print("Answer = ", answer)
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition