-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path134 prog.py
71 lines (63 loc) · 1.52 KB
/
134 prog.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
list1=[]
list2=[]
list3=[]
print("enter title")
title=input()
list1.append(title)
print("enter author")
author=input()
list2.append(author)
print("enter price")
price=input()
list3.append(price)
print("enter \"add book\" for enter a new book or enter \"display\" for display books")
option=input()
class book:
def __init__(self,l1,l2,l3):
self.l1=l1
self.l2=l2
self.l3=l3
def read(self):
self.l1=0
self.l2=0
self.l3=0
def display(self):
print("title of books:")
for i in self.l1:
print(i)
print("author of books:")
for j in self.l2:
print(j)
print("price of books:")
for k in self.l3:
print(k)
if option=="":
print("DO you want to continue?")
con=input()
if (con=="yes"):
print("enter title")
title1=input()
list1.append(title1)
print("enter author")
author1=input()
list2.append(author1)
print("enter price")
price1=input()
list3.append(price1)
else:
print("exit")
if (option=="add book"):
print("enter title")
title2=input()
list1.append(title2)
print("enter author")
author2=input()
list2.append(author2)
print("enter price")
price2=input()
list3.append(price2)
obj1=book(list1,list2,list3)
if (option=="display"):
obj1.display()
else:
obj1.display()