Code CS Project
Code CS Project
import mysql.connector as ms
def display_options():
"""Displays the available options for the user"""
print("The options are:")
print("1. Add book")
print("2. Search book")
print("3. Remove book")
print("4. Add customer")
print("5. Search customer")
print("6. Remove customer")
print("7. Exit")
add_book()
search_book()
remove_book()
elif opt == 4: # Add customer
def add_cust():
cname = input('Enter the Customer name: ')
bname = input('Enter the book name: ')
try:
bprice = float(input('Enter the price of the book: '))
except ValueError:
print("Invalid price. Please enter a valid number.")
return
bcat = input('Enter the category of the book (Comic,
Story, Novel, Study Guide, Subject): ')
add_cust()
search_cust()
remove_cust()
else:
print("Invalid option. Please choose a number between 1
and 7.")