Python set update() method
Add every item from other collections.
Syntax
set.update(*iterables)
Parameters
| *iterables | the items to add |
Return value
None
Example
Code
s = {1, 2} s.update([2, 3], {4, 5}) print(s)
Output
{1, 2, 3, 4, 5}
Related
Learn it step by step in the free lesson Dictionaries & Sets, with exercises that check your answers.