Advertisement
Guest User

python kieg példa

a guest
Feb 9th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. import random
  2.  
  3.  
  4. class RandomTestClass:
  5.     def __init__(self, number) -> None:
  6.         super().__init__()
  7.         self.number = number
  8.  
  9.     def __str__(self) -> str:
  10.         return str(self.number)
  11.  
  12.     def my_method(self, some_thing, another_thing=None):
  13.         print("I'm called now with " + str(some_thing) + str(another_thing))
  14.  
  15.  
  16. test = RandomTestClass(1)
  17. test.my_method(2)
  18.  
  19. print(random.randrange(3))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement