77print (firstset ) # {True, 38.8, 88, 'aiquest', 383}
88print (type (firstset )) # set output --- <class 'dict'>
99
10+ # set hocche unique , duplicate remove kore dibe
11+ # Access item korte for loop use korte hbe
12+ # discard diye remove kore
13+ # set Union | ei symbol use kori . ekhane sob value nibe
14+ # set intersection hocche commnon value nibe, duplicate remove korbe
15+
16+ duration = {2 , 3 , 4 , 45 , 3 , 3 ,4 }
17+ print (type (duration ))
18+ #remove duplicate automatic
19+ print ("remove duplicte automatic " , duration ) # 2, 3, 4, 45
20+ # access item 1st wa y
21+ # set access korte for loop use korte hbe
22+ for x in duration :
23+ print ("acces item" , x )
24+
25+ # 2nd way to access
26+ print (1001 in duration ) # false
27+
28+ # add item
29+ duration .add (99 )
30+ print ("add item" , duration ) # {2, 99, 3, 4, 45} # buji nai
31+ # discard
32+ duration .discard (3333 ) # buji nai
33+ print ('discard ' , duration )
34+
35+ # del keyword
36+ #del duration
37+ print ('delete set' , duration ) # bujij nai # ekane exception dibe
38+
39+ # set union
40+ success = {3 , 3 , 2 , 4 }
41+ print ("set union" , duration | success )
42+ # set intersection
43+ print ('set intersection' , duration & success )
0 commit comments