File tree 6 files changed +10
-10
lines changed 6 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ def brake(self, value):
34
34
print (f"Braking to { self .speed } km/h..." )
35
35
36
36
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 } )"
38
38
39
39
def __repr__ (self ):
40
40
return (
Original file line number Diff line number Diff line change @@ -16,4 +16,4 @@ def radius(self, value):
16
16
self ._radius = value
17
17
18
18
def area (self ):
19
- return round ( math .pi * self ._radius ** 2 , 2 )
19
+ return math .pi * self ._radius ** 2
Original file line number Diff line number Diff line change 1
1
class A :
2
2
def method (self ):
3
- print ("A.method" )
3
+ print ("A.method() " )
4
4
5
5
6
6
class B (A ):
7
7
def method (self ):
8
- print ("B.method" )
8
+ print ("B.method() " )
9
9
10
10
11
11
class C (A ):
12
12
def method (self ):
13
- print ("C.method" )
13
+ print ("C.method() " )
14
14
15
15
16
16
class D (B , C ):
Original file line number Diff line number Diff line change @@ -37,11 +37,11 @@ def __init__(self):
37
37
self .position = 0
38
38
39
39
def move_up (self , distance = 1 ):
40
- self .position += 1
40
+ self .position += distance
41
41
print (f"Moving arm { distance } cm up..." )
42
42
43
43
def move_down (self , distance = 1 ):
44
- self .position -= 1
44
+ self .position -= distance
45
45
print (f"Moving arm { distance } cm down..." )
46
46
47
47
def weld (self ):
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ def __init__(self, radius):
21
21
self .radius = radius
22
22
23
23
def area (self ):
24
- return round ( math .pi * self .radius ** 2 , 2 )
24
+ return math .pi * self .radius ** 2
25
25
26
26
27
27
class Square :
@@ -31,4 +31,4 @@ def __init__(self, side):
31
31
self .side = side
32
32
33
33
def area (self ):
34
- return round ( self .side ** 2 , 2 )
34
+ return self .side ** 2
Original file line number Diff line number Diff line change @@ -13,4 +13,4 @@ def side(self, value):
13
13
self ._side = value
14
14
15
15
def calculate_area (self ):
16
- return round ( self ._side ** 2 , 2 )
16
+ return self ._side ** 2
You can’t perform that action at this time.
0 commit comments