Which of the following set methods does not modify the set but returns a new set?
- difference()
- intersection()
- issubset()
- union()
The union() method returns a new set that contains all the elements from both sets without modifying the original sets.
Loading...
Related Quiz
- The ____ method is used to pre-fetch the next value of a generator object.
- You have a function that takes three parameters, but sometimes you need to pass more arguments. Which technique allows for this?
- How can you identify the parts of your Python code that are consuming the most time?
- A ____ is a data structure that stores elements in a linear sequence but allows additions and removals only at the start.
- You are assigned to write a Python script that needs to execute a block of code only if a file exists at a specified location. How would you implement this control structure to check the existence of the file and execute the block of code?