Create a set named rose_garden containing different types of roses: "red rose", "white rose", "yellow rose". Print the same.
Add "pink rose" to the rose_garden set. Print the set to confirm the addition.
Remove "yellow rose" from the rose_garden set using the remove() method. Print the set to verify the removal.
Create another set botanical_garden with elements "sunflower", "tulip", and "red rose". Find the union of rose_garden and botanical_garden and print the result.
Find the intersection of rose_garden and botanical_garden and print the common elements.
Find the difference between rose_garden and botanical_garden and print the elements that are only in rose_garden.
Find the symmetric difference between rose_garden and botanical_garden and print the elements unique to each set.
Create a set small_garden containing "red rose", "white rose". Check if small_garden is a subset of rose_garden and print the result.
Check if rose_garden is a superset of small_garden and print the result.
Use the len() function to find the number of elements in the rose_garden set. Print the result.
Use the discard() method to remove "pink rose" from the rose_garden set. Try to discard a non-existent element "blue rose" and observe what happens.
Use the clear() method to remove all elements from the rose_garden set. Print the set to confirm itβs empty.
Make a copy of the botanical_garden set using the copy() method. Add "lily" to the copy and print both sets to see the differences.
Create a frozen set immutable_garden with elements "orchid", "daisy", "red rose". Try to add or remove an element and observe what happens.
Iterate over the botanical_garden set and print each element.
Use set comprehension to create a set even_numbers containing even numbers from 1 to 10.
Given a list of flowers ["rose", "tulip", "rose", "daisy", "tulip"], use a set to remove duplicates and print the unique flowers.
Check if "sunflower" is in the botanical_garden set and print the result.
Use the intersection_update() method to update the botanical_garden set with only the elements found in rose_garden. Print the updated set.
Use the difference_update() method to remove all elements in small_garden from botanical_garden. Print the updated set.