Dec-12-2017, 01:31 AM
(Dec-12-2017, 01:27 AM)sparkz_alot Wrote: 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'.
Alright, you are going to hate me for this... First of all, I do have an idea of return functions, I just am not able to realize a difference between them and prints. Secondly, I found out the reason why nothing popped up was because of line 39 and this wonderful command called break. As it was defining my functions, I think it read break as a cue to stop defining and to end the program. The second I removed the break command, it started working.
Thank you for teaching me so much though (especially the format command, that will be a life saver in the future.)