forked from tdwojak/Python2017
commited tasks
This commit is contained in:
parent
f372aff821
commit
a0d2623f9f
@ -1,3 +1,20 @@
|
||||
#!/usr/bin/env python2
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
class Employee:
|
||||
id_prac = 1
|
||||
def __init__ (self,imie, nazwisko):
|
||||
self.imie = imie
|
||||
self.nazwisko = nazwisko
|
||||
self.id_prac = Employee.id_prac
|
||||
Employee.id_prac += 1
|
||||
def get_id (self):
|
||||
return self.id_prac
|
||||
|
||||
|
||||
prac1 = Employee("X1","Y1")
|
||||
prac2 = Employee("X2","Y2")
|
||||
|
||||
print(prac1.get_id())
|
||||
print(prac2.get_id())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user