-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstrength.py
More file actions
41 lines (33 loc) · 1.13 KB
/
strength.py
File metadata and controls
41 lines (33 loc) · 1.13 KB
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
40
41
# Class for strength subclass of exercise
from exercise import Exercise
from random import randint
class Strength(Exercise):
def __init__(self,duration=15, bodyGroup='Total Body' , reps=None, sets=None, exerciseType='Free Weight'):
print("Strength class is called")
super(Strength, self).__init__(duration, bodyGroup, 2, 'Strength')
if reps is None:
self.reps = randint(6,12)
else:
self.reps = reps
if sets is None:
self.sets = randint(2,4)
else:
self.sets = sets
self.type = exerciseType
def __str__(self):
return 'Strength of type : ' + self.type + ', ' + str(self.sets) + ' sets with ' + str(self.reps) + ' reps per set.'
def test(self):
Exercise.test(self)
print("Strength")
print("Reps")
print(self.reps)
print("Sets")
print(self.sets)
print("Type")
print(self.type)
#ex = Strength(duration = 20, bodyGroup='Arms',reps = 15, sets = 3, type = 'Machine')
#ex.test()
#ex2 = Strength(reps = 15, sets = 3, type = 'Machine')
#ex2.test()
#ex3 = Strength()
#ex3.test()