How does “if n is within 10 of either 100 or 200” correlate with using the absolute value function? I get what absolute value is, but wouldn’t there be an easier/cleaner way without using abs()? Thanks Answer Sure: you absolutely could (and I’d say should) write that like: which I think more clearly communicates your intent to the next person
Tag: absolute-value
How to find the maximum x value of a function?
I need to find the maximum x value associated to the maximum y value of the following function that I plot using Python matplotlib module: Hence, the trend is this one: If I use the max() function in such way: It prints only the maximum y value (that in this case is equal to 0.8306243772229114). How can I do to