Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. class myClass:
  2. counter = 0
  3. def someFunction():
  4. #here is some codes
  5. string = "my string"
  6. globale counter
  7. for i in range(0, len(string))
  8. counter += 1
  9. return string
  10.  
  11. def anotherFunction():
  12. return counter
  13.  
  14. class myClass:
  15. counter = 0
  16. def someFunction():
  17. #here is some codes
  18. string = "my string"
  19. for i in range(0, len(string))
  20. counter += 1
  21. return string, counter
  22.  
  23. def anotherFunction():
  24. return someFunction()[1]
  25.  
  26. class myClass:
  27. def __init__(self):
  28. self.counter = 0
  29. def someFunction():
  30. #here is some codes
  31. string = "my string"
  32. for i in range(0, len(string))
  33. self.counter += 1
  34. return string
  35.  
  36. def anotherFunction(self):
  37. return self.counter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement