Changes between Version 114 and Version 115 of python
- Timestamp:
- Oct 11, 2016, 10:59:25 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
python
v114 v115 810 810 811 811 class MyClass: 812 def __init__(self): 812 def __init__(self): # self je instanca objekta 813 813 self.variable1 = 1 814 814 self.variable2 = 2 815 def foo(self): # Parameter self bomo razložili kasneje815 def foo(self): 816 816 print("Hello from the function foo") 817 817 818 818 819 my_object = MyClass() 820 my_object1 = MyClass() 821 822 my_object.variable2 = 3 # Spremenimo vrednost shranjene vrednosti spremenljivke variable2 v objektu my_objectchange value stored in variable2 in my_object819 my_object = MyClass() # objekt je ustvarjen 820 my_object1 = MyClass() 821 822 my_object.variable2 = 3 # Spremenimo vrednost shranjene vrednosti spremenljivke variable2 823 823 824 824 print(my_object.variable2) 825 825 print(my_object1.variable2) 826 826 827 my_object.foo() # call method foo() of object my_object827 my_object.foo() # call method foo() of object MyClass 828 828 829 829 print(my_object.variable1)