Sets and Set Methods
✕Set Operations
Question 1 of 2
- Find movies released in 2025 that user has watched
- Find movies released in 2025 that user has not watched
- Find movies watched by user that were not released in 2025
- Customers are top buyers of all electronics, cosmetics and groceries
- Customers who are top buyer of single category only
- Customers who are top buyers of exactly two categories
- All unique customers who are top buyers of at least one category
- Customers who are top buyers of electronics but not cosmetics
Ask user for movies released in year 2025 and store as set. Ask user again for movies watched (any year) and perform followingDaaraz found that their top electronic gadget buyer's areram,shyam,sita,hari. Cosmetic buyers arehari,sita,gita,rita. Top grocery buyer's areram,hari,gitaandrabi. Find:Data related Operations
Question 2 of 2
- Save unique items sold in stationary shop in a set as
unq_items_setand display the result - Find and display total number of unique items sold in stationary shop
- Add
sticky_notestounq_items_setset and display updated set - Remove
penfromunq_items_setset and display updated set - Check if
stapleris present inunq_items_setset and display result - Remove
eraserfromunq_items_setand display result. Shouldn't give error if not present - Assign
new_itemsas["highlighter", "chart_paper"]. Add all items fromnew_itemstounq_items_setand display updated set
Store list as["book", "book", "pen", "pen", "pen", "pencil", "marker", "notebook"]- Save unique items sold in stationary shop in a set as
