def main(): r = Rectangle("синий", 3, 2) c = Circle("зеленый", 5) s = Square("красный", 5) print(r) print(c) print(s)
def main(): rectangle = Rectangle(3, 2, "blue") circle = Circle(5, "green") square = Square(5, "red") print(rectangle) print(circle) print(square)
def main(): r = Rectangle("Синего", 3, 2) c = Circle("Красного", 5) s = Square("Желтого", 5) print(r) print(c) print(s)
def main(): rectangle = Rectangle("синего", 2, 2) circle = Circle("зеленого", 5) square = Square("красного", 2) print(rectangle) print(circle) print(square)
def main(): print(Fore.GREEN + 'Павловская А.А. ИУ5-51Б') print(Style.RESET_ALL) figure1 = Rectangle("синего", 15, 15) figure2 = Circle("зеленого", 15) figure3 = Square("красного", 15) print(figure1) print(figure2) print(figure3)
def main(): r = Rectangle(12, 12, "синего") c = Circle(12, "зелёного") s = Square(12, "красного") print(Back.BLUE) print(r) print(Back.GREEN) print(c) print(Back.RED) print(s)
def main(): print("ИУ5-51Б Пахомкин Кирсан Лаб №2") #print(arrow.now(), "\n") rectangle = Rectangle("синего", 16, 16) circle = Circle("зеленого", 16) square = Square("красного", 16) print(rectangle) print(circle) print(square)
def main(): print("Выполнил: Дюжев Степан Андреевич ИУ5Ц-73Б") rect = Rectangle(73, 73, "blue") circle = Circle(73, "green") square = Square(73, "red") print(rect) print(circle) print(square) pprint.pprint(get_location_info())
def main(): print("ИУ5-51Б Андреев Александр Владимирович Лаб №2") #print(arrow.now(), "\n") rectangle = Rectangle("синего", 16, 16) circle = Circle("зеленого", 16) square = Square("красного", 16) print(rectangle) print(circle) print(square)
def main(): print("\nДубянский Антон Игоревич, ИУ5Ц-71Б, Лаб №2\n") rectangle = Rectangle("синего", 2, 2) circle = Circle("зеленого", 2) square = Square("красного", 2) print(rectangle) print(circle) print(square)
from lab_python_oop.Rectangle import Rect from lab_python_oop.Squar import Squar from lab_python_oop.Circle import Circle if __name__ == "__main__": myrect = Rect(2,3, "Blue") mysquere = Squar(5, "Red") mycircle = Circle(5, "Green") print(myrect.repr()) print(mysquere.repr()) print(mycircle.repr())
from lab_python_oop.Rectangle import Rectangle from lab_python_oop.Circle import Circle from lab_python_oop.Square import Square if __name__ == "__main__": rect = Rectangle(3, 2, "синий") rect.repr() circle = Circle(5, "зеленый") circle.repr() square = Square(5, "красный") square.repr()
import lab_python_oop.Exceptions as e from lab_python_oop.Rectangle import Rectangle from lab_python_oop.Circle import Circle from lab_python_oop.Square import Square # Wow. It's raises exception :) try: r = Rectangle(1, 1, 'unreal_color') print(r) except e.LabException as err: print('Expected exception:', err) print() r = Rectangle(3, 2, 'blue') print(r) c = Circle(5, 'green') print(c) s = Square(5, 'red') print(s) # How do you like that, Elon Musk? s.width = 10 # Spoiler: everything is ok. # Because I overloaded the properties print(s)
def main(): r, c, s = Rectangle(21, 21, 'синий'), Circle(21, 'зеленый'), Square(21, 'красный') print(r, c, s, sep='\n')
from lab_python_oop.Rectangle import Rect from lab_python_oop.Square import Square from lab_python_oop.Circle import Circle c = Circle(3, 'зеленый') s = Square(2, 'красный') v = Rect(5, 4, 'Коричневый') print(c) print(s) print(v)
from lab_python_oop.Rectangle import Rectangle from lab_python_oop.Square import Square from lab_python_oop.Circle import Circle if __name__ == "__main__": r1 = Rectangle(3, 2, "Синий") print(r1) s1 = Square(5, "Красный") print(s1) c1 = Circle(5, "Зелёный") print(c1)