Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SomeNum:
- def __init__(self,number):
- self.number = number
- def boring_print(self):
- for numb in self.number:
- print numb
- class_var = SomeNum()
- # first initialization of the class which runs __init__
- print class_var.number[1,2,3]
- # prints the variable [1,2,3,4,5] that you set in init
- print class_var.boring_print()
- # also prints the variable [1,2,3,4,5] that you set in init
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement