Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class myClass:
- counter = 0
- def someFunction():
- #here is some codes
- string = "my string"
- globale counter
- for i in range(0, len(string))
- counter += 1
- return string
- def anotherFunction():
- return counter
- class myClass:
- counter = 0
- def someFunction():
- #here is some codes
- string = "my string"
- for i in range(0, len(string))
- counter += 1
- return string, counter
- def anotherFunction():
- return someFunction()[1]
- class myClass:
- def __init__(self):
- self.counter = 0
- def someFunction():
- #here is some codes
- string = "my string"
- for i in range(0, len(string))
- self.counter += 1
- return string
- def anotherFunction(self):
- return self.counter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement