MCPcopy Create free account
hub / github.com/geekcomputers/Python / ohms_law

Function ohms_law

Electronics_Algorithms/Ohms_law.py:1–12  ·  view source on GitHub ↗
(v=0, i=0, r=0)

Source from the content-addressed store, hash-verified

1def ohms_law(v=0, i=0, r=0):
2 if v == 0:
3 result = i * r
4 return result
5 elif i == 0:
6 result = v / r
7 return result
8 elif r == 0:
9 result = v / i
10 return result
11 else:
12 return 0

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected