Ohms law is an important and fundamental rule to remember when working with resistors and electronics in general. It defines the relationship between the components’ current I in amps (A), voltage V in volts (V) and resistance R in ohms (Ω). Ohm’s law consists of three mathematical equations that explain the relationship between current, voltage and resistance. If you know two of these values.
pip install ohmslaw
from ohmslaw import Ohms
>>> from ohmslaw import Ohms
>>>
>>> R1, R2, R3 = 280, 450, 100
>>>
>>> o = Ohms()
>>> series = o.series(R1, R2, R3)
>>>
>>> print("Resistors in series = ", series)
Resistors in series = 830
>>>
>>> o = Ohms()
>>> results = o.volts(I=12, R=4)
>>>
>>> print(results)
48
>>>
>>> o = Ohms()
>>> results = o.current(V=12, R=4)
>>>
>>> print(results)
3.0
>>>
>>> o = Ohms()
>>> results = o.resistance(V=48, I=4)
>>>
>>> print(results)
12.0
>>>
>>> o = Ohms()
>>> results = o.watts(I=2, R=15)
>>>
>>> print(results)
60
>>>