input and makes them immutable. # Simply it freezes the iterable objects and
makes them unchangeable. # Python program to understand frozenset()
function # set declaration number = {1, 2, 3, 4, 5, 6, 7, 8, 9} print ("Object type of number is ",type(number)) # converting Sets to frozenset fnumber = frozenset(number) print ("object type of fnumber is ",type(fnumber)) # printing details print("frozenset Object is : ", fnumber) # Python program to understand use # of frozenset function # creating a dictionary info = {"fname": "vijay", "age": 30, "sex": "Male",} # making keys of dictionary as frozenset key = frozenset(info) # printing keys details print('The frozen set is:', key) # Python program to understand # use of frozenset function # below line will generate error #TypeError: 'frozenset' object does not support
The generated files are base64-encoded encryption keys in plain text format. If you select a password for your private key, its file will be encrypted with your password. Be sure to remember this password or the key pair becomes useless.
# A setisan unordered collection of Unique elements. seta=set('abcd') print (seta) l = ['apple','banana','orange','graps'] print ("object type is", type(l),) b=set(l) # converted List into set objects print ("Object Type is ", type(b),) s = {'apple','banana','orange','graps'} print ("object type is", type(s),) c=set(s) # converted List into set objects print ("Object Type is ", type(c),) example=set('abcdefg') print ("define variable",example) example.add('z') print ("define variable",example) d=example.copy() print("copy set example",d) example.remove('a') print("removed a element from example set",example) list1 = [1, 2, 3] list2 = [5, 6, 7] set1 = set(list2) set2 = set(list1) # Update method set1.update(set2) # Print the updated set print("set update example",set1) example.discard ('c') print ("discard c example",example) example.clear() print ("clear example",example)