-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExercise4.py
More file actions
39 lines (20 loc) · 715 Bytes
/
Copy pathExercise4.py
File metadata and controls
39 lines (20 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
def area(length, width):
return length * width
def perimeter(length, width):
return 2 * length + 2 * width
def volume(length, width, height):
return length * width * height
def surfaceArea(length, width, height):
return (length * width * 2) + (length * height * 2) + (width * height * 2)
assert area(10, 10) == 100
assert area(0, 9999) == 0
assert area(5, 8) == 40
assert perimeter(10, 10) == 40
assert perimeter(0, 9999) == 19998
assert perimeter(5, 8) == 26
assert volume(10, 10, 10) == 1000
assert volume(9999, 0, 9999) == 0
assert volume(5, 8, 10) == 400
assert surfaceArea(10, 10, 10) == 600
assert surfaceArea(9999, 0, 9999) == 199960002
assert surfaceArea(5, 8, 10) == 340