dasturlash
Предварительный просмотр (4 стр.)
Прокрутите вниз 👇
О "dasturlash"
1 >> class book: def __init__(self, title, author, year, pages): self.title = title self.author = author self.year = year self.pages = pages def display_info(self): print(f"nazvanie: {self.title}, avtor: {self.author}, god: {self.year}, stranits: {self.pages}") book1 = book("prestuplenie i nakazanie", "f.m. dostoevskiy", 1866, 671) book1.display_info() 2 >> class rectangle: def __init__(self, width, height): self.width = width self.height = height def area(self): return self.width * self.height def perimeter(self): return 2 * (self.width + self.height) def is_square(self): return self.width == self.height rect1 = rectangle(5, 3) print(rect1.area()) print(rect1.perimeter()) print(rect1.is_square()) rect2 = rectangle(4, 4) print(rect2.is_square()) 3 >> class counter: def __init__(self, start...
Этот файл содержит 4 стр. в формате DOCX (13,6 КБ). Чтобы скачать "dasturlash", нажмите кнопку Telegram слева.