1 00:00:00,000 --> 00:00:02,500 [no audio] 2 00:00:02,500 --> 00:00:05,000 Friends, here we are going to discuss the last 3 00:00:05,000 --> 00:00:07,300 default data structure of your Python, 4 00:00:07,300 --> 00:00:09,000 that is set data structure. 5 00:00:10,000 --> 00:00:11,600 Let me open my terminal, 6 00:00:13,300 --> 00:00:17,500 and I'm entering into 'python' terminal, right. See if you want 7 00:00:17,500 --> 00:00:18,700 to define any set, 8 00:00:18,700 --> 00:00:24,000 let's say 'my_set={' with normal values. 9 00:00:25,700 --> 00:00:27,800 You can define any value, okay. 10 00:00:29,200 --> 00:00:31,700 See that, now I am printing my set. 11 00:00:31,700 --> 00:00:34,900 [no audio] 12 00:00:34,900 --> 00:00:37,300 So the way how you are giving, 13 00:00:38,400 --> 00:00:42,000 , but it is giving output as 14 00:00:43,300 --> 00:00:47,800 in ascending order, that means whatever the data you're providing 15 00:00:47,800 --> 00:00:52,300 it is not giving the same order. That means sets are called 16 00:00:52,300 --> 00:00:54,700 unordered collection of data. 17 00:00:55,400 --> 00:00:59,300 And if you give any data multiple times, if you give data, 18 00:01:00,600 --> 00:01:03,800 duplicates data or multiple times of data, suppose 19 00:01:03,800 --> 00:01:05,300 I have given 7, two times, 20 00:01:06,599 --> 00:01:11,500 so set will give unique data. Duplicates will be removed by 21 00:01:11,500 --> 00:01:13,300 default. That's it. 22 00:01:14,800 --> 00:01:21,100 Now if we convert your data into Boolean, 'True', because it is 23 00:01:21,100 --> 00:01:23,000 non-empty set, right? 24 00:01:23,500 --> 00:01:26,800 Let me define 'my_set' which is having a non empty, 25 00:01:26,800 --> 00:01:28,800 [no audio] 26 00:01:28,800 --> 00:01:29,900 sorry empty set. 27 00:01:30,500 --> 00:01:33,300 So guys if you want to define empty set you have to write 28 00:01:33,400 --> 00:01:36,400 a 'set()', because if you define direct straight 29 00:01:36,400 --> 00:01:38,500 forward curly brace that will become dictionary. 30 00:01:39,700 --> 00:01:42,600 Now print the type of your 'my_set'. 31 00:01:42,600 --> 00:01:46,500 [no audio] 32 00:01:46,500 --> 00:01:51,000 Now let me print Boolean of your 'my_set'. It is 'False' because 33 00:01:51,000 --> 00:01:52,100 empty set, right? 34 00:01:52,900 --> 00:01:55,400 So guys, this is the way how you can define your set, 35 00:01:56,500 --> 00:01:58,600 right, and how you can convert your set into Boolean, 36 00:01:58,600 --> 00:02:00,600 and what is the data you are getting when your set is 37 00:02:00,600 --> 00:02:05,600 empty. Let's say I'm having a list called 'my_list 38 00:02:07,000 --> 00:02:08,000 equals to, 39 00:02:08,000 --> 00:02:10,400 [no audio] 40 00:02:10,400 --> 00:02:16,300 you can convert this list into set, 'set(my_list)'. 41 00:02:16,300 --> 00:02:18,900 [no audio] 42 00:02:18,900 --> 00:02:22,300 That's it. In case you have any data multiple times 43 00:02:22,300 --> 00:02:27,400 in your list your set will give the unique data. 44 00:02:28,700 --> 00:02:29,700 That's it, 45 00:02:30,500 --> 00:02:35,600 and anyway it is ascending order, that means unordered collection 46 00:02:35,600 --> 00:02:37,300 actually, right. Fine. 47 00:02:37,900 --> 00:02:40,900 So if you want to see the different types of operations on 48 00:02:40,900 --> 00:02:43,400 your sets simply you can run this and you can see. 49 00:02:43,400 --> 00:02:50,400 [no audio] 50 00:02:50,400 --> 00:02:55,800 So, or you can do you know, let's say set 'a' is there in this way 51 00:02:56,800 --> 00:03:02,700 , and set 'b' is there in this way . 52 00:03:02,700 --> 00:03:05,600 [no audio] 53 00:03:05,600 --> 00:03:11,000 So I want to find 'a union b', right. 'a.union(b)'. 54 00:03:11,000 --> 00:03:14,400 See the output. 'a.intersection', 55 00:03:14,400 --> 00:03:17,600 [no audio] 56 00:03:17,600 --> 00:03:20,000 'intersection(b)'. That's it. 57 00:03:21,700 --> 00:03:25,200 Okay. So guys there are remaining operations as well, 58 00:03:25,200 --> 00:03:27,800 but on automation side no where we are going to touch this 59 00:03:27,800 --> 00:03:29,000 set data structure. 60 00:03:29,000 --> 00:03:33,300 If you are interested you can go and learn about your remaining 61 00:03:33,500 --> 00:03:37,800 operations on your sets. I've gone through only union, intersection, 62 00:03:37,800 --> 00:03:40,800 if you are interested about sets anyway, your mathematics 63 00:03:40,800 --> 00:03:43,600 sets operation only, right. You can go and see the remaining 64 00:03:43,600 --> 00:03:45,000 operations, okay. 65 00:03:46,600 --> 00:03:48,700 Okay guys, thank you for watching this video. 66 00:03:48,700 --> 00:03:50,677 [no audio]