May-22-2017, 08:04 PM
I'm playing with some formulas and I ran across this warning
Type float doesn't have expected attribute '__div__'
with the "resist_2" in this line:volt_div(volt_in, resist_1, resist_2)Here is the full function:
def volt_div(v_in, res_1, res_2): # resistor_2 = res_2 # Needed to make Python's __div__ happy v_out = v_in * (res_2 / (res_1 + res_2)) print("Output of voltage divider = {:.4f} VDC".format(v_out)) return volt_in = 10.0 resist_1 = 10.0 resist_2 = 10.0 volt_div(volt_in, resist_1, resist_2)It doesn't seem to affect the outcome, but I am curious as to what it means.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition