Question: Q# 3 : ( 7 points ) Suppose you are given the following sets representing categories of books in a library system: Write a Python

Q#3: (7 points) Suppose you are given the following sets representing categories of books in a library system:
Write a Python program that carries out the following tasks:
Find and display the titles that are considered both fiction and non-fiction.
Identify and list books that are unique to each category (no book from the list should appear in any other category).
Display a list of books that are either in the fiction or non-fiction category but exclude those that are in the biographies.
Create a new set for "must-read" books that combines selections from all three categories but only includes books that are mentioned in more than
one category.
Determine if the set of biographies is a proper subset of the union of fiction and non-fiction sets.
Using set operations, identify the symmetric difference between the combined sets of fiction and non-fiction and the set of biographies. List the results
in alphabetical order.
For each category, display the books in a sorted list (alphabetically) and count how many titles are in each.Q#3: (7 points) Suppose you are given the following sets representing categories of books in a library system:
fiction: set(["To Kill a Mockingbird", "1984", "The Great Gatsby", "Brave New World", "Catch-22", "Animal Farm"])
non_fiction: set(["A Brief History of Time", "The Selfish Gene", "Guns, Germs, and Steel", "The Righteous Mind", "Sapiens", "1984"])
biographies: set(["The Diary of a Young Girl", "Long Walk to Freedom", "Steve Jobs", "Into the Wild", "Sapiens", "A Beautiful Mind"])
Write a Python program that carries out the following tasks:
Find and display the titles that are considered both fiction and non-fiction.
Identify and list books that are unique to each category (no book from the list should appear in any other category).
Display a list of books that are either in the fiction or non-fiction category but exclude those that are in the biographies.
Create a new set for "must-read" books that combines selections from all three categories but only includes books that are mentioned in more than one category.
Determine if the set of biographies is a proper subset of the union of fiction and non-fiction sets.
Using set operations, identify the symmetric difference between the combined sets of fiction and non-fiction and the set of biographies. List the results in alphabetical order.
For each category, display the books in a sorted list (alphabetically) and count how many titles are in each.
Q# 3 : ( 7 points ) Suppose you are given the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!