Changes between Version 117 and Version 118 of python


Ignore:
Timestamp:
Oct 27, 2016, 2:42:32 PM (8 years ago)
Author:
mtelenta
Comment:

primer imort modulov v python-u

Legend:

Unmodified
Added
Removed
Modified
  • python

    v117 v118  
    812812
    813813print(my_object.variable1)
     814}}}
     815
     816=== Import modulov in funkcij ===
     817
     818{{{
     819#!python
     820
     821# -*- coding: utf-8 -*-
     822vsota = 6
     823def sum(x, y):
     824    vsota = x + y
     825    print("Lokalna vsota je: ", vsota)
     826
     827def sub(x, y):
     828    raz = x - y
     829    print("Lokalna razlika je: ", raz)
     830
     831if __name__ == '__main__':
     832
     833    # Pokličemo funkcijo sum
     834    sum(2, 3)
     835    sub(6, 4)
     836
     837    print("Globalna vsota je: ", vsota)
    814838}}}
    815839