Skip to content

Commit 7588aeb

Browse files
committed
Fix wqSquare coordonate 2
1 parent 2a9d8e8 commit 7588aeb

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

0x06-python-classes/6-square.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,17 @@ def _getPosition(self):
4343

4444
def _setPosition(self, newPosition):
4545
"""
46-
Getter property for Position attribute
46+
Setter property for Position attribute
4747
"""
48-
if (not isinstance(newPosition, tuple) or
49-
len(newPosition) != 2 or
50-
not all(isinstance(x, int) for x in newPosition) or
51-
not all(x >= 0 for x in newPosition)):
52-
raise TypeError("position must be a tuple of 2 positive integers")
48+
if (not isinstance(newPosition, tuple)):
49+
raise TypeError("position must be a tuple of 2 positive integers")
50+
if len(newPosition) != 2:
51+
raise TypeError("position must be a tuple of 2 positive integers")
52+
if not all(isinstance(x, int) for x in newPosition):
53+
raise TypeError("position must be a tuple of 2 positive integers")
54+
if not all(x >= 0 for x in newPosition):
55+
raise TypeError("position must be a tuple of 2 positive integers")
56+
5357
self.__position = newPosition
5458

5559
def area(self):

0 commit comments

Comments
 (0)