forked from tdwojak/Python2017
commited tasks
This commit is contained in:
parent
6fd225e26b
commit
0233fb9ede
@ -1,3 +1,28 @@
|
|||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python2
|
||||||
# -*- coding: utf-8 -*-
|
# -*- 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])
|
||||||
|
Loading…
Reference in New Issue
Block a user