The code is converting a tuple val into a set. The val tuple contains the values 'T', 'u', 't', 'o', 'r', 'J', 'o', 'e' , 's'. First, the tuple val is printed along with its type, which is tuple. Next, the code converts the tuple val into a set and assigns the result to the variable s. The converted set is then printed along with its type, which is set.
val = ('T', 'u', 't', 'o', 'r', 'J', 'o', 'e' , 's') print(val) print(type(val)) print("\nConvert Tuple to Set\n") s = set(val) print(s) print(type(s))
('T', 'u', 't', 'o', 'r', 'J', 'o', 'e', 's') <class 'tuple'> Convert Tuple to Set {'J', 'o', 'u', 's', 'e', 'r', 'T', 't'} <class 'set'>
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions