Quiz: Python Sets
Challenge your Python knowledge with this quiz on sets, covering set creation, uniqueness, mutability, and methods like add(), remove(), and update().
1.
Which of the following is a correct characteristic of a Python set?
2.
What will this code output?
python
1 2
fruits_set = {"apple", "banana", "cherry", "apple"} print(fruits_set)
3.
Which method allows you to add multiple items to a set at once?
4.
What is the result of this code?
python
1
print(type({"apple", "banana"}))
5.
How can you check if "apple" is in a set named fruits?