Python:
class book:
def __init__(self, author, name, date):
self.author = author
self.name = name
self.date = date
def print(self):
print(self.name, self.author, self.date)
book1 = book("абоба", "математика 8 класс", 1951)
book2 = book("абоба", "информатика 8 класс", 1992)
book3 = book("абоба", "математика 10 класс", 1991)
book4 = book("абоба1", "математика 10 класс", 1994)
book5 = book("абоба1", "информатика 10 класс", 1955)
book6 = book("абоба1", "информатика 11 класс", 1993)
book7 = book("абоба", "физика 8 класс", 1952)
book8 = book("абоба", "информатика 8 класс", 1871)
book9 = book("абоба1", "физика 8 класс", 1951)
book10 = book("абоба1", "физика 8 класс", 1971)
library = [book1, book2, book3, book4, book5, book6, book7, book8, book9, book10]
# a
author = "абоба" # автор, книги которого ищем
print("а)")
for i in range(len(library)):
if library[i].author == author and library[i].date >= 1960:
print(library[i].name)
# б
print("б)")
for k in library[i].name.split():
if k == 'информатика':
library[i].print()
# в
print("в)")
for i in range(len(library) - 1):
for j in range(i + 1, len(library)):
if library[i].author == library[j].author and library[i].name == library[j].name:
library[j].print()
Python:
class book:
def __init__(self, author, name, date):
self.author = author
self.name = name
self.date = date
def print(self):
print(self.name, self.author, self.date)
book1 = book("абоба", "математика 8 класс", 1951)
book2 = book("абоба", "информатика 8 класс", 1992)
book3 = book("абоба", "математика 10 класс", 1991)
book4 = book("абоба1", "математика 10 класс", 1994)
book5 = book("абоба1", "информатика 10 класс", 1955)
book6 = book("абоба1", "информатика 11 класс", 1993)
book7 = book("абоба", "физика 8 класс", 1952)
book8 = book("абоба", "информатика 8 класс", 1871)
book9 = book("абоба1", "физика 8 класс", 1951)
book10 = book("абоба1", "физика 8 класс", 1971)
library = [book1, book2, book3, book4, book5, book6, book7, book8, book9, book10]
# a
author = "абоба" # автор, книги которого ищем
print("а)")
for i in range(len(library)):
if library[i].author == author and library[i].date >= 1960:
print(library[i].name)
# б
print("б)")
for i in range(len(library)):
for k in library[i].name.split():
if k == 'информатика':
library[i].print()
# в
print("в)")
for i in range(len(library) - 1):
for j in range(i + 1, len(library)):
if library[i].author == library[j].author and library[i].name == library[j].name:
library[i].print()
library[j].print()
diya_1 = input("Введіть дію: ")
num_2 = int(input("Введіть 2 число: "))
diya_2 = input("Введіть дію: ")
num_3 = int(input("Введіть 3 число: "))
if diya_1 == '/':
if diya_2 == '/':
print(num_1,'/',num_2,'/',num_3,'= ', num_1/num_2/num_3)
if diya_2 == '*':
print(num_1,'*',num_2,'/',num_3,'= ', num_1*num_2/num_3)
if diya_2 == '-':
print(num_1,'-',num_2,'/',num_3,'= ', num_1-num_2/num_3)
if diya_2 == '-':
print(num_1,'+',num_2,'/',num_3,'= ', num_1+num_2/num_3)
if diya_1 == '+':
if diya_2 == '*':
print(num_1,'+',num_2,'*',num_3,'= ', num_1+num_2*num_3)
if diya_2 == '/':
print(num_1,'+',num_2,'/',num_3,'= ', num_1+num_2/num_3)
if diya_2 == '+':
print(num_1,'+',num_2,'+',num_3,'= ', num_1+num_2+num_3)
if diya_2 == '-':
print(num_1,'+',num_2,'-',num_3,'= ', num_1+num_2-num_3)
if diya_1 == '*':
if diya_2 == '+':
print(num_1,'*',num_2,'+',num_3,'= ', num_1*num_2+num_3)
if diya_2 == '-':
print(num_1,'*',num_2,'-',num_3,'= ', num_1*num_2-num_3)
if diya_2 == '/':
print(num_1,'*',num_2,'/',num_3,'= ', num_1*num_2/num_3)
if diya_2 == '*':
print(num_1,'*',num_2,'*',num_3,'= ', num_1*num_2*num_3)
if diya_1 == '/':
if diya_2 == '-':
print(num_1,'/',num_2,'/',num_3,'= ', num_1/num_2/num_3)
if diya_2 == '+':
print(num_1,'*',num_2,'+',num_3,'= ', num_1/num_2+num_3)
if diya_2 == '*':
print(num_1,'-',num_2,'*',num_3,'= ', num_1/num_2*num_3)
if diya_2 == '-':
print(num_1,'+',num_2,'-',num_3,'= ', num_1/num_2-num_3)