From 0233fb9edeed4012cc0697c532eceb350050f89f Mon Sep 17 00:00:00 2001 From: s45150 Date: Fri, 15 Dec 2017 23:10:58 +0100 Subject: [PATCH] commited tasks --- labs04/task03.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/labs04/task03.py b/labs04/task03.py index 88741a4..d879fcb 100644 --- a/labs04/task03.py +++ b/labs04/task03.py @@ -1,3 +1,28 @@ #!/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])