I am writing some python code in PyCharm. It is giving me a warning when I write the following test.
return factor >= 1.0 and factor <= 2.0
Information on the warning says it is showing because the comparison can be simplified.
Is there a better way of writing this comparison.

return 1 <= factor <= 2
This will eliminate that, as it's combining the two comparisons.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With