Python Calculations With Variable Resistor