24 lines
272 B
Python
Executable File
24 lines
272 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
|
|
class Counter:
|
|
|
|
def __init__(self):
|
|
self.n = 0
|
|
|
|
def inc(self):
|
|
self.n += 1
|
|
|
|
def __str__(self):
|
|
return str(self.n)
|
|
|
|
|
|
counter = Counter()
|
|
|
|
|
|
def run():
|
|
print("\tTest Global Class:", counter)
|
|
counter.inc()
|
|
|
|
|