PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
class Library:
def __init__(self, author, title, year):
self.author = author
self.title = title
self.year = year
encyclopedia = Library("Joy Ray", "Big nature", 1998)
adventure = Library("Tom Cross", "Around Earth", 2016)
comedy = Library("Chin Chaplin", "Face smile", 1978)
drama = Library("Jack Rent", "Black tear", 2012)
fantasy = Library("John Blend", "Terrifying beast", 2017)
'''@property
def autorr(self):
return self.author
'''
user_input = input("Type author surname or full info: ")
# @autorr.getter
'''def search(self, author):
self.author = author
'''
if user_input == "Joy Ray" or "Ray":
print(encyclopedia.title)
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run