update
This commit is contained in:
parent
2992f4f408
commit
4f46de8d00
3330 changed files with 394553 additions and 76939 deletions
21
.config/Code/User/History/5b4566d4/1vPS.py
Normal file
21
.config/Code/User/History/5b4566d4/1vPS.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
found = True
|
||||
break
|
||||
if not found:
|
||||
print('book title not function')
|
17
.config/Code/User/History/5b4566d4/22Cc.py
Normal file
17
.config/Code/User/History/5b4566d4/22Cc.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
||||
for key in book.keys():
|
||||
print(key, ' : ', book.get(key))
|
||||
break
|
51
.config/Code/User/History/5b4566d4/297x.py
Normal file
51
.config/Code/User/History/5b4566d4/297x.py
Normal file
|
@ -0,0 +1,51 @@
|
|||
def getdict(books: list, title: str) -> dict:
|
||||
for book in books:
|
||||
book = dict(book)
|
||||
if book.get('title') == title:
|
||||
return book
|
||||
return None
|
||||
|
||||
def inventory_worth():
|
||||
worth = 0
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
worth += book.get('price')*book.get('quantity')
|
||||
return worth
|
||||
|
||||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
|
||||
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
|
||||
book = getdict(bookstore, search_title)
|
||||
if book is None:
|
||||
print('book title not function')
|
||||
else:
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
|
||||
update_title = input('enter a title to update a book: ')
|
||||
book = getdict(bookstore, update_title)
|
||||
if book is None:
|
||||
print('book title not function')
|
||||
else:
|
||||
new_author = input('enter updated author')
|
||||
new_quantity = input('enter updated quantity')
|
||||
new_price = input('enter updated price')
|
||||
book['author'] = new_author
|
||||
book['quantity'] = new_quantity
|
||||
book['price'] = new_price
|
||||
|
||||
|
||||
|
||||
|
||||
|
44
.config/Code/User/History/5b4566d4/63Rs.py
Normal file
44
.config/Code/User/History/5b4566d4/63Rs.py
Normal file
|
@ -0,0 +1,44 @@
|
|||
def getdict(books: list, title: str) -> dict:
|
||||
for book in books:
|
||||
book = dict(book)
|
||||
if book.get('title') == title:
|
||||
return book
|
||||
return None
|
||||
|
||||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
|
||||
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
|
||||
book = getdict(bookstore, search_title)
|
||||
if book is None:
|
||||
print('book title not function')
|
||||
else:
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
|
||||
update_title = input('enter a title to update a book: ')
|
||||
book = getdict(bookstore, update_title)
|
||||
if book is None:
|
||||
print('book title not function')
|
||||
else:
|
||||
new_author = input('enter updated author')
|
||||
new_quantity = input('enter updated quantity')
|
||||
new_price = input('enter updated price')
|
||||
book['author'] = new_author
|
||||
book['quantity'] = new_quantity
|
||||
book['price'] = new_price
|
||||
|
||||
|
||||
|
||||
|
||||
|
16
.config/Code/User/History/5b4566d4/83bx.py
Normal file
16
.config/Code/User/History/5b4566d4/83bx.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
for i in range(num):
|
||||
title = input('enter book title for book ', i, ': ')
|
||||
author = input('enter book author for book ', i, ': ')
|
||||
quantity = input('enter book quantity for book ', i, ': ')
|
||||
price = input('enter book price for book ', i, ': ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
||||
for details in book:
|
||||
print(details)
|
16
.config/Code/User/History/5b4566d4/8bFS.py
Normal file
16
.config/Code/User/History/5b4566d4/8bFS.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
bookstore = []
|
||||
|
||||
num = input('how many books would you like to add: ')
|
||||
for i in range(num):
|
||||
title = input('enter book title for book ', i, ': ')
|
||||
author = input('enter book author for book ', i, ': ')
|
||||
quantity = input('enter book quantity for book ', i, ': ')
|
||||
price = input('enter book price for book ', i, ': ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
||||
for details in book:
|
||||
print(details)
|
51
.config/Code/User/History/5b4566d4/8w7p.py
Normal file
51
.config/Code/User/History/5b4566d4/8w7p.py
Normal file
|
@ -0,0 +1,51 @@
|
|||
def getdict(books: list, title: str) -> dict:
|
||||
for book in books:
|
||||
book = dict(book)
|
||||
if book.get('title') == title:
|
||||
return book
|
||||
return None
|
||||
|
||||
def inventory_worth():
|
||||
worth = 0
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
worth += int(book.get('price'))*int(book.get('quantity'))
|
||||
return worth
|
||||
|
||||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
|
||||
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
|
||||
book = getdict(bookstore, search_title)
|
||||
if book is None:
|
||||
print('book title not function')
|
||||
else:
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
|
||||
update_title = input('enter a title to update a book: ')
|
||||
book = getdict(bookstore, update_title)
|
||||
if book is None:
|
||||
print('book title not function')
|
||||
else:
|
||||
new_author = input('enter updated author: ')
|
||||
new_quantity = input('enter updated quantity: ')
|
||||
new_price = input('enter updated price: ')
|
||||
book['author'] = new_author
|
||||
book['quantity'] = new_quantity
|
||||
book['price'] = new_price
|
||||
|
||||
print('you have books worth: ',inventory_worth(), 'rupee')
|
||||
|
||||
|
||||
|
16
.config/Code/User/History/5b4566d4/B7tF.py
Normal file
16
.config/Code/User/History/5b4566d4/B7tF.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
||||
for details in book:
|
||||
print(details)
|
57
.config/Code/User/History/5b4566d4/CHEj.py
Normal file
57
.config/Code/User/History/5b4566d4/CHEj.py
Normal file
|
@ -0,0 +1,57 @@
|
|||
def getdict(books: list, title: str) -> dict:
|
||||
for book in books:
|
||||
book = dict(book)
|
||||
if book.get('title') == title:
|
||||
return book
|
||||
return None
|
||||
|
||||
def inventory_worth():
|
||||
worth = 0
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
worth += int(book.get('price'))*int(book.get('quantity'))
|
||||
return worth
|
||||
|
||||
def report():
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
|
||||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
|
||||
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
|
||||
book = getdict(bookstore, search_title)
|
||||
if book is None:
|
||||
print('book title not function')
|
||||
else:
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
|
||||
update_title = input('enter a title to update a book: ')
|
||||
book = getdict(bookstore, update_title)
|
||||
if book is None:
|
||||
print('book title not function')
|
||||
else:
|
||||
new_author = input('enter updated author: ')
|
||||
new_quantity = input('enter updated quantity: ')
|
||||
new_price = input('enter updated price: ')
|
||||
book['author'] = new_author
|
||||
book['quantity'] = new_quantity
|
||||
book['price'] = new_price
|
||||
|
||||
print('you have books worth: ',inventory_worth(), 'rupee')
|
||||
report()
|
||||
|
||||
|
8
.config/Code/User/History/5b4566d4/E8n4.py
Normal file
8
.config/Code/User/History/5b4566d4/E8n4.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
bookstore = []
|
||||
|
||||
num = input('how many books would you like to add: ')
|
||||
for i in range(num):
|
||||
title = input('enter book title for book ', i, ': ')
|
||||
author = input('enter book author for book ', i, ': ')
|
||||
quantity = input('enter book quantity for book ', i, ': ')
|
||||
price = input('enter book price for book ', i, ': ')
|
24
.config/Code/User/History/5b4566d4/FTTv.py
Normal file
24
.config/Code/User/History/5b4566d4/FTTv.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
found = True
|
||||
break
|
||||
if not found:
|
||||
print('book title not function')
|
||||
|
||||
update_title = input('enter a title to update a book: ')
|
||||
|
13
.config/Code/User/History/5b4566d4/GRA5.py
Normal file
13
.config/Code/User/History/5b4566d4/GRA5.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
bookstore = []
|
||||
|
||||
num = input('how many books would you like to add: ')
|
||||
for i in range(num):
|
||||
title = input('enter book title for book ', i, ': ')
|
||||
author = input('enter book author for book ', i, ': ')
|
||||
quantity = input('enter book quantity for book ', i, ': ')
|
||||
price = input('enter book price for book ', i, ': ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
for book in bookstore:
|
||||
|
33
.config/Code/User/History/5b4566d4/Gzt2.py
Normal file
33
.config/Code/User/History/5b4566d4/Gzt2.py
Normal file
|
@ -0,0 +1,33 @@
|
|||
def getdict(books: list, title: str) -> dict:
|
||||
for book in books:
|
||||
book = dict(book)
|
||||
if book.get('title') == title:
|
||||
return book
|
||||
return None
|
||||
|
||||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
|
||||
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
book = getdict(bookstore, search_title)
|
||||
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
found = True
|
||||
break
|
||||
if not found:
|
||||
print('book title not function')
|
||||
|
||||
update_title = input('enter a title to update a book: ')
|
17
.config/Code/User/History/5b4566d4/L1Yk.py
Normal file
17
.config/Code/User/History/5b4566d4/L1Yk.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
break
|
11
.config/Code/User/History/5b4566d4/LAqI.py
Normal file
11
.config/Code/User/History/5b4566d4/LAqI.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
bookstore = []
|
||||
|
||||
num = input('how many books would you like to add: ')
|
||||
for i in range(num):
|
||||
title = input('enter book title for book ', i, ': ')
|
||||
author = input('enter book author for book ', i, ': ')
|
||||
quantity = input('enter book quantity for book ', i, ': ')
|
||||
price = input('enter book price for book ', i, ': ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
15
.config/Code/User/History/5b4566d4/LKfn.py
Normal file
15
.config/Code/User/History/5b4566d4/LKfn.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
bookstore = []
|
||||
|
||||
num = input('how many books would you like to add: ')
|
||||
for i in range(num):
|
||||
title = input('enter book title for book ', i, ': ')
|
||||
author = input('enter book author for book ', i, ': ')
|
||||
quantity = input('enter book quantity for book ', i, ': ')
|
||||
price = input('enter book price for book ', i, ': ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
||||
|
32
.config/Code/User/History/5b4566d4/NVYV.py
Normal file
32
.config/Code/User/History/5b4566d4/NVYV.py
Normal file
|
@ -0,0 +1,32 @@
|
|||
def getdict(books: list) -> dict:
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
||||
found = True
|
||||
break
|
||||
if not found:
|
||||
return None
|
||||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
|
||||
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
found = True
|
||||
break
|
||||
if not found:
|
||||
print('book title not function')
|
||||
|
||||
update_title = input('enter a title to update a book: ')
|
16
.config/Code/User/History/5b4566d4/PTT4.py
Normal file
16
.config/Code/User/History/5b4566d4/PTT4.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
||||
print(book.keys())
|
||||
print(book.values())
|
31
.config/Code/User/History/5b4566d4/Svv5.py
Normal file
31
.config/Code/User/History/5b4566d4/Svv5.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
def getdict(books: list) -> dict:
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
||||
return book
|
||||
return None
|
||||
|
||||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
|
||||
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
found = True
|
||||
break
|
||||
if not found:
|
||||
print('book title not function')
|
||||
|
||||
update_title = input('enter a title to update a book: ')
|
20
.config/Code/User/History/5b4566d4/UxJx.py
Normal file
20
.config/Code/User/History/5b4566d4/UxJx.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
found = True
|
||||
break
|
||||
if not found:
|
||||
print('book title not function')
|
11
.config/Code/User/History/5b4566d4/aQUp.py
Normal file
11
.config/Code/User/History/5b4566d4/aQUp.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
bookstore = []
|
||||
|
||||
num = input('how many books would you like to add: ')
|
||||
for i in range(num):
|
||||
title = input('enter book title for book ', i, ': ')
|
||||
author = input('enter book author for book ', i, ': ')
|
||||
quantity = input('enter book quantity for book ', i, ': ')
|
||||
price = input('enter book price for book ', i, ': ')
|
||||
bookstore.append({title : [author, quantity, price]})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
21
.config/Code/User/History/5b4566d4/b41e.py
Normal file
21
.config/Code/User/History/5b4566d4/b41e.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
found = True
|
||||
break
|
||||
if not found:
|
||||
print('book title not function')
|
1
.config/Code/User/History/5b4566d4/entries.json
Normal file
1
.config/Code/User/History/5b4566d4/entries.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":1,"resource":"file:///home/rafayahmad/Stuff/Coding/Python/IDS/lab3/task2.py","entries":[{"id":"wDhU.py","timestamp":1725421605403},{"id":"i9F0.py","timestamp":1725421711590},{"id":"hFQE.py","timestamp":1725421730677},{"id":"E8n4.py","timestamp":1725421773879},{"id":"mEnz.py","timestamp":1725421811156},{"id":"aQUp.py","timestamp":1725421883378},{"id":"LAqI.py","timestamp":1725421945135},{"id":"GRA5.py","timestamp":1725421985676},{"id":"sGVN.py","timestamp":1725422118608},{"id":"fRsZ.py","timestamp":1725422140831},{"id":"LKfn.py","timestamp":1725422175994},{"id":"8bFS.py","timestamp":1725422192044},{"id":"83bx.py","timestamp":1725422224217},{"id":"B7tF.py","timestamp":1725422279140},{"id":"PTT4.py","timestamp":1725422375516},{"id":"22Cc.py","timestamp":1725422964010},{"id":"L1Yk.py","timestamp":1725423021450},{"id":"UxJx.py","timestamp":1725423101674},{"id":"b41e.py","timestamp":1725423119011},{"id":"1vPS.py","timestamp":1725424246234},{"id":"FTTv.py","timestamp":1725424988091},{"id":"uHcX.py","timestamp":1725425011055},{"id":"NVYV.py","timestamp":1725425115622},{"id":"Svv5.py","timestamp":1725425152336},{"id":"j6D0.py","timestamp":1725425163396},{"id":"kYms.py","timestamp":1725425191563},{"id":"v1gK.py","timestamp":1725425210593},{"id":"Gzt2.py","timestamp":1725425296520},{"id":"o2kN.py","timestamp":1725425331127},{"id":"nBwS.py","timestamp":1725425366241},{"id":"h7w0.py","timestamp":1725425387324},{"id":"jgwj.py","timestamp":1725425490021},{"id":"63Rs.py","timestamp":1725425537708},{"id":"297x.py","timestamp":1725425687599},{"id":"kZ4o.py","timestamp":1725425737616},{"id":"o62K.py","timestamp":1725425761340},{"id":"8w7p.py","timestamp":1725425841120},{"id":"CHEj.py","timestamp":1725426141499},{"id":"jBhL.py","timestamp":1725426273047}]}
|
14
.config/Code/User/History/5b4566d4/fRsZ.py
Normal file
14
.config/Code/User/History/5b4566d4/fRsZ.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
bookstore = []
|
||||
|
||||
num = input('how many books would you like to add: ')
|
||||
for i in range(num):
|
||||
title = input('enter book title for book ', i, ': ')
|
||||
author = input('enter book author for book ', i, ': ')
|
||||
quantity = input('enter book quantity for book ', i, ': ')
|
||||
price = input('enter book price for book ', i, ': ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
29
.config/Code/User/History/5b4566d4/h7w0.py
Normal file
29
.config/Code/User/History/5b4566d4/h7w0.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
def getdict(books: list, title: str) -> dict:
|
||||
for book in books:
|
||||
book = dict(book)
|
||||
if book.get('title') == title:
|
||||
return book
|
||||
return None
|
||||
|
||||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
|
||||
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
|
||||
book = getdict(bookstore, search_title)
|
||||
if book is None:
|
||||
print('book title not function')
|
||||
else:
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
|
||||
update_title = input('enter a title to update a book: ')
|
7
.config/Code/User/History/5b4566d4/hFQE.py
Normal file
7
.config/Code/User/History/5b4566d4/hFQE.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
bookstore = []
|
||||
|
||||
num = input('how many books would you like to add: ')
|
||||
for i in range(num):
|
||||
title = input('enter book title for book ', i, ': ')
|
||||
author = input('enter book author for book ', i, ': ')
|
||||
title = input('enter book title for book ', i, ': ')
|
5
.config/Code/User/History/5b4566d4/i9F0.py
Normal file
5
.config/Code/User/History/5b4566d4/i9F0.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
bookstore = []
|
||||
|
||||
num = input('how many books would you like to add: ')
|
||||
for i in range(num):
|
||||
title = input('enter book title for book ', i, ': ')
|
31
.config/Code/User/History/5b4566d4/j6D0.py
Normal file
31
.config/Code/User/History/5b4566d4/j6D0.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
def getdict(books: list) -> dict:
|
||||
for book in books:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
||||
return book
|
||||
return None
|
||||
|
||||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
|
||||
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
found = True
|
||||
break
|
||||
if not found:
|
||||
print('book title not function')
|
||||
|
||||
update_title = input('enter a title to update a book: ')
|
59
.config/Code/User/History/5b4566d4/jBhL.py
Normal file
59
.config/Code/User/History/5b4566d4/jBhL.py
Normal file
|
@ -0,0 +1,59 @@
|
|||
def getdict(books: list, title: str) -> dict:
|
||||
for book in books:
|
||||
book = dict(book)
|
||||
if book.get('title') == title:
|
||||
return book
|
||||
return None
|
||||
|
||||
def inventory_worth():
|
||||
worth = 0
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
worth += int(book.get('price'))*int(book.get('quantity'))
|
||||
return worth
|
||||
|
||||
def report():
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
if book.get('quantity') == '0':
|
||||
print('boooook ouuut off stooooooock!!!!!!!!!!!!!!!!!!')
|
||||
|
||||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
|
||||
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
|
||||
book = getdict(bookstore, search_title)
|
||||
if book is None:
|
||||
print('book title not function')
|
||||
else:
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
|
||||
update_title = input('enter a title to update a book: ')
|
||||
book = getdict(bookstore, update_title)
|
||||
if book is None:
|
||||
print('book title not function')
|
||||
else:
|
||||
new_author = input('enter updated author: ')
|
||||
new_quantity = input('enter updated quantity: ')
|
||||
new_price = input('enter updated price: ')
|
||||
book['author'] = new_author
|
||||
book['quantity'] = new_quantity
|
||||
book['price'] = new_price
|
||||
|
||||
print('you have books worth: ',inventory_worth(), 'rupee')
|
||||
report()
|
||||
|
||||
|
36
.config/Code/User/History/5b4566d4/jgwj.py
Normal file
36
.config/Code/User/History/5b4566d4/jgwj.py
Normal file
|
@ -0,0 +1,36 @@
|
|||
def getdict(books: list, title: str) -> dict:
|
||||
for book in books:
|
||||
book = dict(book)
|
||||
if book.get('title') == title:
|
||||
return book
|
||||
return None
|
||||
|
||||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
|
||||
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
|
||||
book = getdict(bookstore, search_title)
|
||||
if book is None:
|
||||
print('book title not function')
|
||||
else:
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
|
||||
update_title = input('enter a title to update a book: ')
|
||||
book = getdict(bookstore, update_title)
|
||||
if book is None:
|
||||
print('book title not function')
|
||||
else:
|
||||
new_author = input('enter updated author')
|
||||
new_quantity = input('enter updated quantity')
|
||||
new_price = input('enter updated price')
|
32
.config/Code/User/History/5b4566d4/kYms.py
Normal file
32
.config/Code/User/History/5b4566d4/kYms.py
Normal file
|
@ -0,0 +1,32 @@
|
|||
def getdict(books: list) -> dict:
|
||||
for book in books:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
||||
return book
|
||||
return None
|
||||
|
||||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
|
||||
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
book = getdict(bookstore)
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
found = True
|
||||
break
|
||||
if not found:
|
||||
print('book title not function')
|
||||
|
||||
update_title = input('enter a title to update a book: ')
|
51
.config/Code/User/History/5b4566d4/kZ4o.py
Normal file
51
.config/Code/User/History/5b4566d4/kZ4o.py
Normal file
|
@ -0,0 +1,51 @@
|
|||
def getdict(books: list, title: str) -> dict:
|
||||
for book in books:
|
||||
book = dict(book)
|
||||
if book.get('title') == title:
|
||||
return book
|
||||
return None
|
||||
|
||||
def inventory_worth():
|
||||
worth = 0
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
worth += book.get('price')*book.get('quantity')
|
||||
return worth
|
||||
|
||||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
|
||||
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
|
||||
book = getdict(bookstore, search_title)
|
||||
if book is None:
|
||||
print('book title not function')
|
||||
else:
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
|
||||
update_title = input('enter a title to update a book: ')
|
||||
book = getdict(bookstore, update_title)
|
||||
if book is None:
|
||||
print('book title not function')
|
||||
else:
|
||||
new_author = input('enter updated author')
|
||||
new_quantity = input('enter updated quantity')
|
||||
new_price = input('enter updated price')
|
||||
book['author'] = new_author
|
||||
book['quantity'] = new_quantity
|
||||
book['price'] = new_price
|
||||
|
||||
print(inventory_worth())
|
||||
|
||||
|
||||
|
9
.config/Code/User/History/5b4566d4/mEnz.py
Normal file
9
.config/Code/User/History/5b4566d4/mEnz.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
bookstore = []
|
||||
|
||||
num = input('how many books would you like to add: ')
|
||||
for i in range(num):
|
||||
title = input('enter book title for book ', i, ': ')
|
||||
author = input('enter book author for book ', i, ': ')
|
||||
quantity = input('enter book quantity for book ', i, ': ')
|
||||
price = input('enter book price for book ', i, ': ')
|
||||
bookstore.append({title : [author, quantity, price]})
|
28
.config/Code/User/History/5b4566d4/nBwS.py
Normal file
28
.config/Code/User/History/5b4566d4/nBwS.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
def getdict(books: list, title: str) -> dict:
|
||||
for book in books:
|
||||
book = dict(book)
|
||||
if book.get('title') == title:
|
||||
return book
|
||||
return None
|
||||
|
||||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
|
||||
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
|
||||
book = getdict(bookstore, search_title)
|
||||
if book is None:
|
||||
print('book title not function')
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
|
||||
update_title = input('enter a title to update a book: ')
|
26
.config/Code/User/History/5b4566d4/o2kN.py
Normal file
26
.config/Code/User/History/5b4566d4/o2kN.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
def getdict(books: list, title: str) -> dict:
|
||||
for book in books:
|
||||
book = dict(book)
|
||||
if book.get('title') == title:
|
||||
return book
|
||||
return None
|
||||
|
||||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
|
||||
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
book = getdict(bookstore, search_title)
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
print('book title not function')
|
||||
|
||||
update_title = input('enter a title to update a book: ')
|
51
.config/Code/User/History/5b4566d4/o62K.py
Normal file
51
.config/Code/User/History/5b4566d4/o62K.py
Normal file
|
@ -0,0 +1,51 @@
|
|||
def getdict(books: list, title: str) -> dict:
|
||||
for book in books:
|
||||
book = dict(book)
|
||||
if book.get('title') == title:
|
||||
return book
|
||||
return None
|
||||
|
||||
def inventory_worth():
|
||||
worth = 0
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
worth += book.get('price')*book.get('quantity')
|
||||
return worth
|
||||
|
||||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
|
||||
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
|
||||
book = getdict(bookstore, search_title)
|
||||
if book is None:
|
||||
print('book title not function')
|
||||
else:
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
|
||||
update_title = input('enter a title to update a book: ')
|
||||
book = getdict(bookstore, update_title)
|
||||
if book is None:
|
||||
print('book title not function')
|
||||
else:
|
||||
new_author = input('enter updated author')
|
||||
new_quantity = input('enter updated quantity')
|
||||
new_price = input('enter updated price')
|
||||
book['author'] = new_author
|
||||
book['quantity'] = new_quantity
|
||||
book['price'] = new_price
|
||||
|
||||
print('you have books worth: ',inventory_worth(), 'rupee')
|
||||
|
||||
|
||||
|
13
.config/Code/User/History/5b4566d4/sGVN.py
Normal file
13
.config/Code/User/History/5b4566d4/sGVN.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
bookstore = []
|
||||
|
||||
num = input('how many books would you like to add: ')
|
||||
for i in range(num):
|
||||
title = input('enter book title for book ', i, ': ')
|
||||
author = input('enter book author for book ', i, ': ')
|
||||
quantity = input('enter book quantity for book ', i, ': ')
|
||||
price = input('enter book price for book ', i, ': ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
for book in bookstore:
|
||||
if book.get('title') == search_title:
|
33
.config/Code/User/History/5b4566d4/uHcX.py
Normal file
33
.config/Code/User/History/5b4566d4/uHcX.py
Normal file
|
@ -0,0 +1,33 @@
|
|||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
found = True
|
||||
break
|
||||
if not found:
|
||||
print('book title not function')
|
||||
|
||||
update_title = input('enter a title to update a book: ')
|
||||
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
found = True
|
||||
break
|
||||
if not found:
|
||||
print('book title not function')
|
33
.config/Code/User/History/5b4566d4/v1gK.py
Normal file
33
.config/Code/User/History/5b4566d4/v1gK.py
Normal file
|
@ -0,0 +1,33 @@
|
|||
def getdict(books: list, title: str) -> dict:
|
||||
for book in books:
|
||||
book = dict(book)
|
||||
if book.get('title') == title:
|
||||
return book
|
||||
return None
|
||||
|
||||
bookstore = []
|
||||
|
||||
num = int(input('how many books would you like to add: '))
|
||||
|
||||
|
||||
for i in range(num):
|
||||
title = input('enter book title: ')
|
||||
author = input('enter book author: ')
|
||||
quantity = input('enter book quantity: ')
|
||||
price = input('enter book price: ')
|
||||
bookstore.append({"title" : title, "author" : author, "quantity" : quantity, "price" : price})
|
||||
|
||||
search_title = input('enter a title to search for a book: ')
|
||||
book = getdict(bookstore, search_title)
|
||||
|
||||
for book in bookstore:
|
||||
book = dict(book)
|
||||
if book.get('title') == search_title:
|
||||
for key in book.keys():
|
||||
print(key, ':', book.get(key))
|
||||
found = True
|
||||
break
|
||||
if not found:
|
||||
print('book title not function')
|
||||
|
||||
update_title = input('enter a title to update a book: ')
|
1
.config/Code/User/History/5b4566d4/wDhU.py
Normal file
1
.config/Code/User/History/5b4566d4/wDhU.py
Normal file
|
@ -0,0 +1 @@
|
|||
bookstore = []
|
Loading…
Add table
Add a link
Reference in a new issue