Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. class SomeNum:
  2. def __init__(self,number):
  3. self.number = number
  4.  
  5. def boring_print(self):
  6. for numb in self.number:
  7. print numb
  8.  
  9.  
  10. class_var = SomeNum()
  11. # first initialization of the class which runs __init__
  12. print class_var.number[1,2,3]
  13.  
  14.  
  15. # prints the variable [1,2,3,4,5] that you set in init
  16.  
  17. print class_var.boring_print()
  18. # also prints the variable [1,2,3,4,5] that you set in init
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement