Advertisement
This is comment for paste
01_rhombus_of_stars_1
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class InputData:
- def __init__(self) -> None:
- self.n: int = int(input())
- class PrintRow:
- def print_row(self, size: int, row: int) -> None:
- empty: str = " "
- star: str = "* "
- print(f"{empty * (size - row)}{star * row}")
- class RhombusPrinter:
- def __init__(self, size: int) -> None:
- self.size: int = size
- self.print_row_obj: PrintRow = PrintRow()
- def print_rhombus(self) -> None:
- self._print_upper_part()
- self._print_center_part()
- self._print_bottom_part()
- def _print_upper_part(self) -> None:
- for row in range(1, self.size):
- self.print_row_obj.print_row(self.size, row)
- def _print_center_part(self) -> None:
- self.print_row_obj.print_row(self.size, self.size)
- def _print_bottom_part(self) -> None:
- for row in range(self.size - 1, 0, -1):
- self.print_row_obj.print_row(self.size, row)
- input_data: InputData = InputData()
- rhombus_printer: RhombusPrinter = RhombusPrinter(input_data.n)
- rhombus_printer.print_rhombus()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement