I know this may not be necessary but im just trying to have a better understanding of classes/modules/methods.
What I want to create is a method like this num.between(low_num, high_num) where the low num does not necessarily need to be provided, if not it wil default to 0. Intergers wil be fine. Dont need to mess with floats for now. Obviously the idea is to check if num is between low_num and high_num.
I havent really had any luck. The closes I've got was with this syntax between(num, low_num, high_num) which I have no real problem getting to work except when I try to make a default argument for low_num. Then python tells me that default arguments must follow positional arguments. Okay I get it... kind of. I think its kind of silly and really ruins the whole idea if I change the placement of the low_num to the end. Then it really doesnt make much sence to me. So anyway please offer any help you can on this. Im really trying to not only solve this small little problem with the positional arguments but more importantly get a better understanding of classes.
Also by the way for the first time chatGTP has really let me down. Actually its been letting me down consistantly on this issue over and over. When I asked it to help me with the default argument issue, at least one time it told me there is no issue with that code. Then at least once it told me there was an issue with it but then sent me back the same exact code that I wrote and told me it was a revised version. Of coarse I also tried re wording things slightly each time to still no avail. Dont know whats up with that but I dont care too much. I prefer the help of my fellow humans anyway.
What I want to create is a method like this num.between(low_num, high_num) where the low num does not necessarily need to be provided, if not it wil default to 0. Intergers wil be fine. Dont need to mess with floats for now. Obviously the idea is to check if num is between low_num and high_num.
I havent really had any luck. The closes I've got was with this syntax between(num, low_num, high_num) which I have no real problem getting to work except when I try to make a default argument for low_num. Then python tells me that default arguments must follow positional arguments. Okay I get it... kind of. I think its kind of silly and really ruins the whole idea if I change the placement of the low_num to the end. Then it really doesnt make much sence to me. So anyway please offer any help you can on this. Im really trying to not only solve this small little problem with the positional arguments but more importantly get a better understanding of classes.
Also by the way for the first time chatGTP has really let me down. Actually its been letting me down consistantly on this issue over and over. When I asked it to help me with the default argument issue, at least one time it told me there is no issue with that code. Then at least once it told me there was an issue with it but then sent me back the same exact code that I wrote and told me it was a revised version. Of coarse I also tried re wording things slightly each time to still no avail. Dont know whats up with that but I dont care too much. I prefer the help of my fellow humans anyway.