Skip to content

Commit

Permalink
Task 6
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronnie5562 committed Jul 22, 2023
1 parent 3e95087 commit 1c9a3b9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions python-classes/6-square.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ def position(self):

@position.setter
def position(self, value):
if (isinstance(value, tuple) and len(value) == 2
and all(isinstance(val, int) for val in value)
and all(val >=0 for val in value)):
if (isinstance(value, tuple) and len(value) == 2 and
all(isinstance(val, int) for val in value) and
all(val >= 0 for val in value)):
self.__position = value
else:
raise TypeError("position must be a tuple of 2 positive integers")
Expand All @@ -51,8 +51,8 @@ def my_print(self):
if self.__size == 0:
print("")
return
[print("") for i in range(0, self.__position[1])]
for i in range(0, self.__size):
[print(" ", end="") for j in range(0, self.__position[0])]
[print("#", end="") for k in range(0, self.__size)]
[print("") for i in range(self.__position[1])]
for i in range(self.__size):
[print(" ", end="") for val in range(self.__position[0])]
[print("#", end="") for val in range(self.__size)]
print()

0 comments on commit 1c9a3b9

Please sign in to comment.