Skip to content

Commit ea44d57

Browse files
authored
Add files via upload
1 parent 6b3723d commit ea44d57

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ex4.1,4.2SolvingLinearEquations.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Write a function to solve linear equations.
2+
'''
3+
For any form of linear equation;
4+
ax + b = cx + d
5+
ax - cx = d - b
6+
x (a - c) = d - b
7+
x = (d - b) / (a - c)
8+
'''
9+
def linearEquation(a, b, c, d):
10+
return (d-b)/(a-c)

0 commit comments

Comments
 (0)