we remove elements from a set by using the discard() method, Again there is no specific index attached to the newly added element.
players = set(['Madueke',' Reece James',' Cole Palmer',' Raheem Sterling',' Levi Colwil',' Thiago Silva',
'Mudryk','cucurella',' Nkunku Christopher'])
players.discard("cucurella")
print(players)
When the above code is executed, it produces the following result.
'Reece James', 'Nkunku Christopher', 'Thiago Silva', 'Mudryk', 'Raheem Sterling', 'Cole Palmer', 'Madueke', 'Levi Colwil'}
Top comments (0)