Question: Q# 3 : ( 7 points ) Suppose you are given the following sets representing categories of books in a library system: Write a Python
Q#: 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 nonfiction.
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 nonfiction category but exclude those that are in the biographies.
Create a new set for "mustread" 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 nonfiction sets.
Using set operations, identify the symmetric difference between the combined sets of fiction and nonfiction 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#: points Suppose you are given the following sets representing categories of books in a library system:
fiction: setTo Kill a Mockingbird", "The Great Gatsby", "Brave New World", "Catch "Animal Farm"
nonfiction: setA Brief History of Time", "The Selfish Gene", "Guns, Germs, and Steel", "The Righteous Mind", "Sapiens",
biographies: setThe 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 nonfiction.
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 nonfiction category but exclude those that are in the biographies.
Create a new set for "mustread" 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 nonfiction sets.
Using set operations, identify the symmetric difference between the combined sets of fiction and nonfiction 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.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
