-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLibraryItem.py
More file actions
30 lines (24 loc) · 837 Bytes
/
LibraryItem.py
File metadata and controls
30 lines (24 loc) · 837 Bytes
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
29
30
import datetime
class LibraryItem:
def __init__(self, t,a,i):
self.__Title = t
self.__AuthorArtist = a
self.__ItemID = i
self.__OnLoan = False
self.__DueDate = datetime.date.today()
def GetTitle(self):
return (self.__Title)
def ShowDetail(self):
print("Title: ", self.GetTitle())
print("Author: ", self.__AuthorArtist)
class Book(LibraryItem):
def __init__(self, t, a, i):
LibraryItem.__init__(self, t, a, i)
self.__IsRequested = False
self.__RequestedBy = 0
def ShowDetail(self):
LibraryItem.ShowDetail(self)
print("is requested: ", self.__IsRequested)
ThisBook = Book("Harry Potter and Deathly Hallows", "J. K. Rowling", 453)
print(ThisBook.GetTitle())
ThisBook.ShowDetail()