Changes between Version 112 and Version 113 of python


Ignore:
Timestamp:
Oct 10, 2016, 2:45:07 PM (8 years ago)
Author:
mtelenta
Comment:

popravka kode za klase

Legend:

Unmodified
Added
Removed
Modified
  • python

    v112 v113  
    809809{{{
    810810#!python
    811 # -*- coding: utf-8 -*-
    812811
    813812class MyClass:
    814     variable1 = 1
    815     variable2 = 2
    816 
     813    def __init__(self):
     814        self.variable1 = 1
     815        self.variable2 = 2
    817816    def foo(self):     # Parameter self bomo razložili kasneje
    818         print("Hello from function foo")
     817        print("Hello from the function foo")
    819818
    820819
     
    830829
    831830print(my_object.variable1)
    832 
    833831}}}
    834832