Ask Experts Questions for FREE Help !
Ask
    LLMH's Avatar
    LLMH Posts: 1, Reputation: 1
    New Member
     
    #1

    Jun 19, 2018, 06:25 PM
    How to create FindStuMaxBorrowedBooks(lib) function in python?
    Function FindStuMaxBorrowedBooks(lib) that will find the students borrowing the most books from the library database. The function should not print out any message on screen but return all the information through the return statement. If there are more than one student who borrows the same maximum number of books, then your code should return all of them.
    In the main program, define a dictionary lib (as shown below) that stores the list of all student identities who borrow books from the library. Call FindStuMaxBorrowedBooks to get the student(s) who borrow the most books. Then, print your result. You should print the student id, and the book(s) borrowed.
    One simple example is illustrated below.
    Lib:
    {0: {'Book 2222', 'Book 1249', 'Book 9228'},
    8: {'Book 2343', 'Book 4354'},
    2: {'Book 3433', 'Book 3545', 'Book 3434'},
    5: {'Book 2321', 'Book 2357'}}
    Output:
    The following students borrowed the most books, i.e. 3 books
    Student ID 0 borrowed:
    {'Book 2222', 'Book 1249', 'Book 9228'}
    Student ID 2 borrowed:
    {'Book 3433', 'Book 3434', 'Book 3545'}

Check out some similar questions!

What do you need to do to own a python [ 8 Answers ]

I really like animals and would like to own a python so what would I need to do to own one

Ball python won't eat [ 4 Answers ]

I noticed today that my husband's ball python who's only 7 months old will not eat. I've tried feeding him, but he's just turning to skin and bones... Literally... I'm scared that there's something wrong.. I've tried once a week to feed him and he just won't eat. His conditions are good, has a...

Ball Python won't eat :( [ 18 Answers ]

Reggie won't eat. He's 3.5 years old and has always eaten a live rat every other week. It's been 5-6 weeks now since he's eaten. He normally eats in his aquarium home. I've tried to put him in a separate container with the rat but all he does is buddy up to the rat. I've had to euthanize...

My First Burmese Python [ 1 Answers ]

This is my first time ever owning a burm. Her name is Pandora she is still an albino burmese python and still a hatching right now. I have owned a Red tailed boa and loved her dearly. My question is this-- For my boa I used sand with a heating pad underneath for bedding and she seemed generally...

Python [ 1 Answers ]

Where can I find programming homeworks for Python?


View more questions Search
 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.