Python Set - Union Method

Method Name: union(anotherSet_in)

Method Overview: 

Combines a set into another set to produce a unified comprehensive set.

Parameters:

anotherSet_in: The set whihc will be unified with the current/this set

Exceptions:

None

Example:

>>> OnlyInUS={"Lake Michigan"}

>>> InUSAndCanada={"Lake Superior","Lake Huron","Lake Erie","Lake Ontario"}

>>> GreatLakes=OnlyInUS.union(InUSAndCanada)

>>> print(GreatLakes)

{'Lake Ontario', 'Lake Michigan', 'Lake Huron', 'Lake Erie', 'Lake Superior'}


Copyright 2023 © pythontic.com