0% found this document useful (0 votes)
13 views2 pages

Library Management system python code

The document outlines a library management system that allows users to view, add, search, and filter books based on various criteria. It includes a list of Indian mythology books by authors such as Amish Tripathi and Sudha Murty, with details like ID, name, author, genre, and price. Users can interact with the system through a menu-driven interface to perform different operations related to the library's collection.

Uploaded by

vidhishree1530
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Library Management system python code

The document outlines a library management system that allows users to view, add, search, and filter books based on various criteria. It includes a list of Indian mythology books by authors such as Amish Tripathi and Sudha Murty, with details like ID, name, author, genre, and price. Users can interact with the system through a menu-driven interface to perform different operations related to the library's collection.

Uploaded by

vidhishree1530
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

list=[

{'id':10001,'name':'Meluha','author':'Amish Tripathi','genre':'Indian
mythology','price':'250'},
{'id':10002,'name':'Nagas','author':'Amish Tripathi','genre':'Indian
mythology','price':'250'},
{'id':10003,'name':'Vayuputras','author':'Amish Tripathi','genre':'Indian
mythology','price':'350'},
{'id':10004,'name':'Ram','author':'Amish Tripathi','genre':'Indian
mythology','price':'250'},
{'id':10005,'name':'Sita','author':'Amish Tripathi','genre':'Indian
mythology','price':'250'},
{'id':10006,'name':'Ravan','author':'Amish Tripathi','genre':'Indian
mythology','price':'350'},
{'id':10007,'name':'The war of lanka','author':'Amish Tripathi','genre':'Indian
mythology','price':'350'},
{'id':10008,'name':'The hidden hindu- Part 1','author':'Akshat
Gupta','genre':'Indian mythology','price':'350'},
{'id':10009,'name':'The hidden hindu- Part 2','author':'Akshat
Gupta','genre':'Indian mythology','price':'350'},
{'id':10010,'name':'The hidden hindu- Part 3','author':'Akshat
Gupta','genre':'Indian mythology','price':'350'},
{'id':10011,'name':"The serpent's revenge",'author':'Sudha
Murty','genre':'Indian mythology','price':'200'},
{'id':10012,'name':'The man from the egg','author':'Sudha
Murty','genre':'Indian mythology','price':'200'},
{'id':10013,'name':'The upside down king','author':'Sudha
Murty','genre':'Indian mythology','price':'200'},
{'id':10014,'name':'The daughter from the wishing tree','author':'Sudha
Murty','genre':'Indian mythology','price':'200'},
{'id':10015,'name':'The sage with two horns','author':'Sudha
Murty','genre':'Indian mythology','price':'200'}
]
name=input('Hello here! Welcome to Vish Library. May i know your name? ')
print('Hello',name,'!','Please choose from the menu given below.')
while True:
print("""\n\nChoose from the following menu:
1. Veiw all the books in the library
2. Add new book
3. Search books by a particular author
4. Display all books with price less than 300
5. Exit""")
c=int(input("Enter your choice (1/2/3/4/5): "))

if c==1:
for i in range(0,len(list)):
print("\nId - ",list[i]['id'],", Name - ",list[i]['name'],", Author -
",list[i]['author'],", Genre - ",list[i]['genre'],", Price - ",list[i]['price'])
if c==2:
id=input("Enter the ID of the book: ")
name=input("Enter the name of the book: ")
author=input("Enter the Author of the book: ")
genre=input("Enter the genre of the book: ")
price=input("Enter the price of the book: ")
d={'id':id,'name':name,'author':author,'genre':genre,'price':price}
list.append(d)
for j in range(0,len(list)):
print("\nId - ",list[j]['id'],", Name - ",list[j]['name'],", Author -
",list[j]['author'],", Genre - ",list[j]['genre'],", Price - ",list[j]['price'])
if c==3:
fauthor=input("Enter the author whose book you need to find: ")
for a in range(len(list)):
if list[a]['author']==fauthor:
print("\nId - ",list[a]['id'],", Name - ",list[a]['name'],", Author
- ",list[a]['author'],", Genre - ",list[a]['genre'],", Price - ",list[a]['price'])

if c==4:
for b in range(len(list)):
if list[b]['price']<='300':
print("\nId - ",list[b]['id'],", Name - ",list[b]['name'],", Author
- ",list[b]['author'],", Genre - ",list[b]['genre'],", Price - ",list[b]['price'])
if c==5:
break

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy