1
0
Fork 0
Python2017/labs04/task03.py

29 lines
566 B
Python

#!/usr/bin/env python2
# -*- coding: utf-8 -*-
class DimensionError(Exception):
def __init__(self):
super().__init__(self)
self.msg = 'Błąd !!!'
class Point():
def __int__(self,wspolrzedne):
if self.isNumeric(wspolrzedne):
self.wspolrzedne = wspolrzedne
else:
self.wspolrzedne = None
def isNumeric(x):
for i in range(len(x)):
if isinstance(x[i], (int, float)) == False:
return False
return True
pkt1 = Point([1, 1, 1])
pkt2 = Point([3, 3, 3])