Other Data Structures: ====================== Strings List Tuple Sets Dictionary Other Data Structures: Frozen Set Bytes Byte Array None Frozen Set: =========== frozenset() =========== ==> can be used to create the frozen set from other collections Syntax: frozenset(any collection) # creating the frozen set from string s1 = "Object Oriented Programming Language" fz1 = frozenset(s1) print(type(fz1)," ",fz1) """ frozen set is same as set. frozen set also not allowed the duplication not an ordered. """ # frozen set creation from list l1 = [10,20,30,40,50] fz2 = frozenset(l1) print(type(fz2)," ",fz2) # frozen set creation from dictionary d1 = {'a':100,'b':200,'c':300} fz3 = frozenset(d1) fz4 = frozenset(d1.values()) print(type(fz3)," ",fz3) print(type(fz4)," ",fz4) fz5 = frozenset({10,20,30,40}) # creating the frozen set from string s1 = "Object Oriented Programming Language" fz1 = frozenset(s1) print(type(fz1)," ",fz1) """ frozen set is same as set. frozen set also not allowed the duplication not an ordered. """ # frozen set creation from list l1 = [10,20,30,40,50] fz2 = frozenset(l1) print(type(fz2)," ",fz2) # frozen set creation from dictionary d1 = {'a':100,'b':200,'c':300} fz3 = frozenset(d1) fz4 = frozenset(d1.values()) print(type(fz3)," ",fz3) print(type(fz5)," ",fz5) ======================================================== Bytes ===== # b1 = bytes("Ashok IT") b1 = bytes([50,200,0,1,3,5,7,9]) b2 = bytes({10,100,200,30,9,7}) print(type(b1)," ",b1) print(b2) # bytes data is ordered print(b1[0]) # bytes data is index based. # b2[2] = 123 # b1.append(100) # b1.insert(1,100) # b1.add(100) print(b2) # Immutable Datatype. ============================================ # x = bytearray({'a':100,'b':200}) x = bytearray({100:101,200:201,250:123,123:101,112:105}.values()) print(x) print(x[2]) x[3] = 102 print(x) x.append(100) print(x[5]) ============================================ None ==== x = None # x = 97 print(type(x)) print(x) print(id(x)) x = 112 print(x,type(x)) print(id(x))