Dec-12-2017, 01:27 AM
return is a value. in order to use it you need to assign it to a variable:
If you are using Python 2.x as was suggested, you should be using 'raw_input' rather than 'input'.
1 2 3 4 5 |
def ask_weight(): lbs = float ( input ( "How many pounds do you weigh? " )) return lbs weight = ask_weight() print str (weight) |
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