Answer to Question #264843 in Python for Jess

Question #264843

Create a program wherein any user should be able to borrow books. Each of the book must have three copies. Indicate how many books are left when they want to borrow a book. Users should be able to check-out and reserve any copy.


1
Expert's answer
2021-11-12T17:36:04-0500
print("1.3 Python books available\n2.3 Java books available")
n=int(input("Enter the book to borrow: "))
if n==1:
    print("You borrowed Python book the remaining python books are 2")
    print("The remaining Java books are 3")
    n=int(input("Enter the book to borrow: "))
    if n==1:
        print("You borrowed Python book the remaining python book is 1")
        print("The remaining Java books are 3")
        n=int(input("Enter the book to borrow: "))
        if n==1:
            print("You borrowed Python book no python book remaining")
            print("The remaining Java books are 3")
    elif n==2:
        print("You borrowed Java book the remaining Java books are 2")
        print("The remaining python books is 1")
if n==2:
    print("You borrowed Java book the remaining Java books are 2")
    print("The remaining Python books are 3")
    n=int(input("Enter the book to borrow: "))
    if n==1:
        print("You borrowed Python book the remaining python book is 2")
        print("The remaining Java books are 2")
        n=int(input("Enter the book to borrow: "))
        if n==1:
            print("You borrowed Python book the remaining python books are 2")
            print("The remaining Java books are 2")
    elif n==2:
        print("You borrowed Java book the remaining Java books is 1")
        print("The remaining python books is 3")
        n=int(input("Enter the book to borrow"))
        if n==1:
            print("You borrowed Python book the remaining Python books are 2")
            print("The remaining Java books is 1")
        elif n==2:
            print("You borrowed Java book no remaining Java books")
            print("The remaining Python books are 3")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS