1
0
Fork 0
This commit is contained in:
Przemysław Kaczmarek 2017-12-14 20:31:14 +01:00
parent aed06ae658
commit e0beb9d336
1 changed files with 15 additions and 5 deletions

View File

@ -27,9 +27,11 @@ class Point():
except IsNumericError as e:
print(e.msg)
def __repr__(self):
return '<Point %s, is numeric: %s>' %(self.points,self.isnumeric)
def __add__(self, other):
try:
new = []
@ -58,7 +60,6 @@ class Point():
print(e.msg)
return len
@staticmethod
def is_numeric(point):
value=0
@ -67,13 +68,22 @@ class Point():
value+=1
return value
def to_string(self):
point_tuple = tuple(self.points)
return str(point_tuple)
def __str__(self):
return (self.to_string())
def TestFunction():
punkt1=Point(['a',2,2])
punkt1=Point([1,2,2])
punkt2=Point([1,7,25])
print(len(punkt1))
print(len(punkt2))
print(punkt1,punkt2,punkt1+punkt2)
print('Ilosc wymiarow: ', len(punkt1))
print('Ilość wymiarów: ', len(punkt2))
punkt3=punkt1+punkt2
print('punkt1 + punkt2 = ',punkt3)
print(punkt1.to_string(),punkt1)
print(punkt2.to_string(),punkt2)
#punkt1.__str__()
TestFunction()