Skip to content

Commit 63915dd

Browse files
authored
Final QA (#569)
1 parent 26c8c1c commit 63915dd

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

python-class/car.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def brake(self, value):
3434
print(f"Braking to {self.speed} km/h...")
3535

3636
def __str__(self):
37-
return f"{self.make}, {self.model}, {self.color}: ({self.year})"
37+
return f"{self.make} {self.model}, {self.color} ({self.year})"
3838

3939
def __repr__(self):
4040
return (

python-class/circle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ def radius(self, value):
1616
self._radius = value
1717

1818
def area(self):
19-
return round(math.pi * self._radius**2, 2)
19+
return math.pi * self._radius**2

python-class/mro.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
class A:
22
def method(self):
3-
print("A.method")
3+
print("A.method()")
44

55

66
class B(A):
77
def method(self):
8-
print("B.method")
8+
print("B.method()")
99

1010

1111
class C(A):
1212
def method(self):
13-
print("C.method")
13+
print("C.method()")
1414

1515

1616
class D(B, C):

python-class/robot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ def __init__(self):
3737
self.position = 0
3838

3939
def move_up(self, distance=1):
40-
self.position += 1
40+
self.position += distance
4141
print(f"Moving arm {distance} cm up...")
4242

4343
def move_down(self, distance=1):
44-
self.position -= 1
44+
self.position -= distance
4545
print(f"Moving arm {distance} cm down...")
4646

4747
def weld(self):

python-class/shapes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(self, radius):
2121
self.radius = radius
2222

2323
def area(self):
24-
return round(math.pi * self.radius**2, 2)
24+
return math.pi * self.radius**2
2525

2626

2727
class Square:
@@ -31,4 +31,4 @@ def __init__(self, side):
3131
self.side = side
3232

3333
def area(self):
34-
return round(self.side**2, 2)
34+
return self.side**2

python-class/square.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ def side(self, value):
1313
self._side = value
1414

1515
def calculate_area(self):
16-
return round(self._side**2, 2)
16+
return self._side**2

0 commit comments

Comments
 (0)