Python Sets

Published: 05 May 2025
on channel: 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


On this page of the site you can watch the video online Python Sets with a duration of hours minute second in good quality, which was uploaded by the user Mastering Technology 05 May 2025, share the link with friends and acquaintances, this video has already been watched 62 times on youtube and it was liked by 8 viewers. Enjoy your viewing!