SHARE
TWEET

Untitled

a guest Jun 19th, 2017 43 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top