Python Tutorial: Set in Python

Published: 23 August 2021
on channel: Learn to code
80
4

#region Notes
"""
Mutable
Un-ordered sequence
No Duplicate values
Heterogenous
Elements should be immutable.
"""
#endregion
a={"Ravi",12,12.5,True,12,12,12}
print((a))
"""
Set ADT
Union of two sets.
Intersection of two set.
Difference of two sets.
symmetric difference of two sets.
Adds all elements of array B to the set A.
Remove all elements of array B to the set A.
"""
#region 1
b=set({1,2,3})
c=({7,4,5,2})
c.add(6)
c.update(b)
print(c)
print(b.union(c))
print(b.intersection(c))
print(b.difference(c))
print(b.symmetric_difference(c))
#endregion


On this page of the site you can watch the video online Python Tutorial: Set in Python with a duration of hours minute second in good quality, which was uploaded by the user Learn to code 23 August 2021, share the link with friends and acquaintances, this video has already been watched 80 times on youtube and it was liked by 4 viewers. Enjoy your viewing!