Jan-26-2020, 02:01 PM
In main lines 28-29 you call take_option_loss and pass it option_ceiling.
In the take_option_loss function you receive option_ceiling but then declare a global option_ceiling, and you return option_ceiling. Which option_ceiling, from which namespace? I'm confused and the interpreter will be too.
If you comment out the global statement (line 4) and then make sure your return statement variable order is the same as in the calling statement (line 27 in main vs line 13 in the function) it should work. I expect that scrambling the order of the variables in the return statement ended up assigning option_ceiling the intended value for option_floor...
In the take_option_loss function you receive option_ceiling but then declare a global option_ceiling, and you return option_ceiling. Which option_ceiling, from which namespace? I'm confused and the interpreter will be too.
If you comment out the global statement (line 4) and then make sure your return statement variable order is the same as in the calling statement (line 27 in main vs line 13 in the function) it should work. I expect that scrambling the order of the variables in the return statement ended up assigning option_ceiling the intended value for option_floor...