Python Sets

Pubblicato il: 05 maggio 2025
sul canale di: Mastering Technology
62
8

Python Sets

Sets are heterogenous.
It is an unordered set of unique objects.
It doesn’t support indexing.
It can grow and shrink.
Relational Operator also works with set , checks whether one set is a subset of another.

sets
t={'orange','apple','grapes','orange'}
print(t)

s= set([1,2,2,3,4])
print(s)

#add a single element
s.add('top')
print(s)

#add multiple elements
s.update(['start',56,78])
print(s)

#remove an element
s.remove('start')
print(s)

#sets #python #programming #unique #objects #heterogenous #elements #various #methods #add #remove #update #union #intersection #relationaloperators #used #check #one #set #subset #of #another

#like #share #subscribe #mychannel


In questa pagina del sito puoi guardare il video online Python Sets della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Mastering Technology 05 maggio 2025, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 62 volte e gli è piaciuto 8 spettatori. Buona visione!