Skip to content

Commit 9d3c6dc

Browse files
committed
New algorithm added
1 parent 47479c1 commit 9d3c6dc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Electronics_Algorithms/Ohms_law.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
def 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

0 commit comments

Comments
 (0)