Skip to content

Commit d25d7c0

Browse files
committed
New code
1 parent cc84532 commit d25d7c0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

code/Week 2/inherit_example.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class C():
2+
num_instances = 0
3+
4+
def __init__(self):
5+
C.num_instances += 1
6+
7+
@staticmethod
8+
def print_num_instances(): # μέθοδος κλάσης
9+
print('Πλήθος στιγμιότυπων είναι :{}'.format(C.num_instances))
10+
# print_num_instances = staticmethod(print_num_instances)

0 commit comments

Comments
 (0)