Changes between Version 114 and Version 115 of python


Ignore:
Timestamp:
Oct 11, 2016, 10:59:25 AM (5 years ago)
Author:
mtelenta
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • python

    v114 v115  
    810810
    811811class MyClass:
    812     def __init__(self):
     812    def __init__(self): # self je instanca objekta
    813813        self.variable1 = 1
    814814        self.variable2 = 2
    815     def foo(self):     # Parameter self bomo razložili kasneje
     815    def foo(self):     
    816816        print("Hello from the function foo")
    817817
    818818
    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_object
     819my_object = MyClass()   # objekt je ustvarjen
     820my_object1 = MyClass() 
     821
     822my_object.variable2 = 3     # Spremenimo vrednost shranjene vrednosti spremenljivke variable2
    823823
    824824print(my_object.variable2)
    825825print(my_object1.variable2)
    826826
    827 my_object.foo()   # call method foo() of object my_object
     827my_object.foo()   # call method foo() of object MyClass
    828828
    829829print(my_object.variable1)