Thestore's a setofthings, andthisisactually a setofuniquethings.
So, forexample, ifyouhave a setofthesetwonumbersoneandthreeandifyoutrytoaddanothernumberthreeheretothisset, nothinghappens.
Usedtohavethissetoneonthreebecause a pythonsetjustrejectsanyduplicateelements.
Okay, let's take a lookatsomecodeexampleshere.
Ifyouwrite a eco's sitparentheses, thiscreates a newemptyset, andthenitassignsittothisviable A.
Soifyouprint a bywritingprint A andthenonceyourunthecell, thisthingisprinted, saidparentheses.
Thisjustwerepresentsanemptyset, allright, Andtoaddelementstothisset, forexample, a numberyoucanjustwrite a dotaddparentheses, oneonthisasthenumberonetotheset.
Soonceyouprint a, youseethisthingcurlybracketsandtheywantinsidethisjustrepresents a sitwithonlyoneinsidetheseton.
Afterthat, ifyouwrite a dot, addtoit'lladdtotothisset.
Andthenonceyou'reprintagain, youseethatNowthisis a setoftwonumbersoneandtwo.
First, create a newlistbywritingnewlistsoneEco's squarebrackets.
Thiscreates a newemptylist.
Youcandothesamethingbywritinglistsparenthesesaswell, andthengoovereveryelementinthesetinthisset 12 andfourbywritingfor X andusethatonecolonforspacesnewestceonethatupend X Sothisway, we'regoingovereveryelementinthenewsetone.
Andtheywere a pendingthattwo.
Newlistonebywritingnewestonedotupend x.
Soafterthat, onceyourprintsnewlists.
One.
Youshouldseethislist 12 andfouronjust a quicknote.
Andyoucanevenmixmultipletypesofthingsin a singlesetsoyoucandoaddone, andthenthisasapplebanana, whicharestringsonone, whichis a numbertwothesamesetbeat.
And I thinkonethingtonotehereisthattheyouknowtheorderinwhichyouseetheseelementsOnebananaonAppleisdifferentfromtheorderinwhichweaddedthesethingsApplebananaontheirone.
So a setis a typeofdatathatdoesn't storetheorderinwhichthingshavebeenaddedtotheset.
Andthat's onewayinwhich a setisdifferentfrom a listinpython.
Andthat's becausewhenyouaddthingsto a listsbyusingtheupendedfunctionlikewesawearlierhere, theorderinwhichthesethingshavebeenaddedtolistsispreserved.
Okay, letmegiveyou a simpleexerciseproblemtopracticeusingwhereyou'vejustlearned.