TI/Skrypty z zajęć/k7
Z Brain-wiki
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 2 12:30:34 2020
@author: Tomek
"""
class Punkt():
__ile_nas = 0
@staticmethod
def kwadratowa(x):
return x**2
@classmethod
def ile_nas(cls):
return cls.__ile_nas
def __init__(self, x, y):
self.__x = x
self.__y = y
Punkt.__ile_nas += 1
def __del__(self):
Punkt.__ile_nas -=1
def getX(self): return self.__x
def getY(self): return self.__y
p1 = Punkt(1,1)
p1 = Punkt(1,4)
p2 = Punkt(5,4)
p3 = Punkt(5,1)