-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcardio.py
More file actions
29 lines (18 loc) · 690 Bytes
/
cardio.py
File metadata and controls
29 lines (18 loc) · 690 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
# Class for cardio subclass of exercise
from exercise import Exercise
from random import randint
class Cardio(Exercise):
def __init__(self,duration=10, bodyGroup='Total Body', cardioType='Treadmill'):
print("Cardio class is called")
super(Cardio, self).__init__(duration, bodyGroup, 2, 'Cardio')
self.type = cardioType
def __str__(self):
return 'Cardio of type : ' + self.type + ' for ' + str(self.duration) + ' minutes.'
def test(self):
Exercise.test(self)
print("Cardio")
print(self.type)
# ex = Cardio(duration = 20, bodyGroup='Arms')
# ex.test()
# ex2 = Cardio(cardioType='Elliptical')
# ex2.test()