Skip to content

Commit fe0628b

Browse files
Updated in Python class
1 parent 7494324 commit fe0628b

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

myMath/arithmatic.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1-
class Arithmatic:
1+
class Arithmatic:
22

3-
def Addition(self, x, y):
3+
#This function does adding to integer
4+
def Add(self, x, y):
45
return x + y
56

6-
7+
#This fnction does su
8+
def Subtraction(self, x, y):
9+
return x - y
10+
11+
12+
13+
14+

myMath/geometric.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
class Geometric:
22

3-
def Multiplication(self, x, y):
4-
return x * y
5-
3+
def Multiplication(self, abc, xyz):
4+
return abc * xyz
5+
6+
def Division(self, x, y):
7+
return x / y
8+

myMath/math.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
class Mathematic:
55

6-
def __init__(self, arithmatic = Arithmatic(), geometric = Geometric()):
7-
self._arithmatic = arithmatic
8-
self._geometrics = geometric
6+
def __init__(self, a = Arithmatic(), pqr = Geometric()):
7+
self._arithmatic = a
8+
self._geometrics = pqr
99

1010
@property
1111
def arithmatic(self):
@@ -16,11 +16,11 @@ def geometric(self):
1616
return self._geometrics
1717

1818
def Add(self, x, y):
19-
result = self.arithmatic.Addition(x, y)
19+
result = self.arithmatic.Add(x, y)
2020
print('Sum of two numbers: ' + str(result))
21-
21+
2222
def Multiply(self, x, y):
2323
result = self.geometric.Multiplication(x, y)
2424
print('Multiplication of two numbers: ' + str(result))
2525

26-
26+

0 commit comments

Comments
 (0)