Python Set - Clear Method

Method Name:

clear()

Method Overview:

Removes all elements from the set, which makes the set as an empty set.

Example:

>>> PrinterQueue = {'Job1',"Job2","Job3","Job4","Job5"}

>>> BackupQueue  = PrinterQueue.copy()

>>> print(BackupQueue)

{'Job3', 'Job2', 'Job4', 'Job1', 'Job5'}


Copyright 2023 © pythontic.com