-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmachines.py
More file actions
26 lines (20 loc) · 733 Bytes
/
machines.py
File metadata and controls
26 lines (20 loc) · 733 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
# Machine class - Parent to all Machines
class Machine:
"""
Description - Parent class to all the machines in the factory.
Arguments :
name <string> - name of the machine
state <bool> - current state of the machine on/off
activity <string>- the process the machine does
"""
def __init__(self, name='default_machine', state="OFF", activity='defaut_activity'):
self.name = name
self.state_name = state
self.activity = activity
def change_state(self, state):
self.state_name = state
pass
def show_state(self):
print(self.name + ' is ' + self.state_name)
def describe(self):
return "{self.name} does {self.activity}"