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