Set is the collection of non repeated elements while list is the collection of any type of element and any number of times. Set is define by { } List is define by [ ]
Set is collection of unique elements, like in list if you repeat something i.e some number like 12 then it is repeated again, but in sets if you write 12 number 2 times then it will display only once, so this is 1st one. 2nd one is set is working on concept of hash, where list not working on concept of hash! 3rd one is in sets index number is not working, because sets can't maintain sequence, but list maintain sequence, eo index number is working in list! So these are some of difference between set and list! Thank you!
1. Set is collection of objects which is shows in curly brackets{} wher list shows in square brackets[] 2. Set is collection of objects where repeation of objects is not allowed but in list repeation of objects is allowed. 3. In set indexing and slicing operation not applied bcz in set sequence is not defined but list performs indexing and slicing.
Shot for the course, being managing Production, Test and Development teams for 15 years, decided this is the year I start learning how to code, so far so good! Last time I touched any form of code was Turbo Pascal in 1990 ! @ Lesson 7 and easy enough to understand!
Fantastic👌, absolutely got crystal clear clarity regarding address of a value assigned to variable, a little bit clarity about garbage collection👍. These are most fundamental concepts and you have made it so easy to understand, love the way you teach❤ Difference between set and list --> List is ordered sequence data type containing similar or different type of collection of data within [ ], Set is a sequence data type but not ordered containing unique collection of datas (not reapted) within { }.
Tbh he explains everything in such a way that the person who watches his video will be left with no clarifications, this is the best part of him, he explains everything so concise, which makes him a better programmer than mosh sorry mosh fans but this guy is truly a miracle ;)
Set is mentioned when there're curly brackets. If you give any numbers, it'll show in an order which is not descending, nor ascending nor the order whatever you gave.
I am completely a beginner.. till now its looking easy.. thats must be because he is an awesome teacher.. Feeling like saying .."Happy Tecahers' Day" Sir
Very impressive.... You are in middle school and you are focussed on learning and enhancing your knowledge and skills.. Very very appreciative of your willingness to learn 👍
A list is an ordered collection of elements that allows duplicate values, while a set is an unordered collection of unique elements. Lists are mutable, meaning you can change, add, or remove elements. Sets are also mutable, but they have built-in methods for set operations like union, intersection, and difference.
Set is a collection of unique elements whereas in list you can repeat elements. Also, when you call set variables, the elements thrown will not be in sequence and will be randomized unlike lists which will throw elements in sequence.
Sir being your old subscriber, i can say your java tutorial videos are discussed more deeply, elaborately and in detailed with lots of different examples/programs in comparison python videos. Still your python videos are good sir🙏..
Thank you..sir..it's really fun learning with you... Differences are set:unique elements, curly braces, not supports index,imutable List:collection of all types, bracket, mutable, support index value
Set is a collection of unique elements, it uses hashing techniques in which data is in random order, it is immutable, where as Lists is a mutable. List contain many methods where as set contains only 2methods:Index,count.
1)set is a unique collection of values.hence it does not allow repeatation while lists don't have any such restrictions. 2)set does not follow any proper sequence of elements but lists do follow. 3)sets does not support indexing but lists do. 4)sets work on hash concept which focuses much on speed rather than sequence.hence they have faster excecution speed but lists are compartively slower.
Explaining very nicely even better than my school teacher,who is also a good teacher ,a teacher of one 0f the top 4 school of Bihar but this guy is a god teacher.
"Variables of the same value are given the same memory address" can sometimes work against you. Learned it the hard way from a code like this: a=[1,2,3] b=a for i in range(1,4): for num in a: b.append(num+i*10) The intent was to make a list of this pattern: [1, 2, 3, 11, 12, 13, 21, 22, 23, ...]. But since python uses the same memory address for a and b, appending list "b" will also change list "a". With the for loop trying go through a list that keeps expanding each iteration, the loop becomes infinite. To avoid this issue, make "a" a tuple (a=tuple(a)) after the line "b=a'. This will result in "a" and "b" having different addresses and less likely to be mixed up.
Set is an unordered collection of unique items, where as a list is an ordered collection of items. List can contain duplicates but a set doesn't allow duplicates. Both are immutable. As set is unordered, it doesn't support indexing but list does.
Set and List both are mutable in nature. The major differences are sets are represented by flower bracket or curly bracket while list in square bracket. Set is a collection of unique elements while list can have any elements including repeated values. Set won't have index value as it can't maintain sequence while lists can!
Enjoying your videos. The explanations take out the confusion. I have learned quite a bit so far. I just cannot see the quiz question because a label is over it. Can you write the questions in the descriptions?
List is an ordered collection of elements in the data structure of Python which allows duplication and is defined by square brackets [ ]; SET is non ordered collection of elements which does not allow duplication of elements and is defined by curly brackets {}. since no duplication is allowed in sets it offers an advantage to look out for specific objects with more efficiency.
Set is collection of unique elements while in set the sequence is maintained and recurring elements are shown once only While 'Lists' are mutable and changed the data is put in square brackets. The values of list can be fetched by using index value. In case of set it can't be used
List is a collection of data, Data can be of different types, Lists can be mutable, Lists is denoted by [ ] square brackes where as in Sets, it do not follow any sequence and denoted by { } curly bracket.
Set vs Lists : 1. In lists when we input values the output will be same as input but when we use set it's not and if in set a number repeats itself more than once it will be printed once. 2.We cannot trace index of value in set whereas lists are capable of doing that. 3. lists are easy to manipulate rather than set as we know exactly where to add element but in set we can't add the value to required slot as in output it will vary with every change. 4.as set use hash concept which we can't find in lists but we can perform manual sorting,descending,deleting,adding in lists in more easier and efficient way.
I am learning the programming for the first time .. my uncle preferred this tutorial to me to learn python i am understanding everything and doing on my computer everyday best explained in a jolly mood i have some issue regaring it how to conatct to u sir
List is shown with square brackets [ ],where as set is shown with curly braces { }.The major difference is that we do some operations such as append ,pop and etc.,in list but we can't in set.
a list is a collection of values which is defined with square bracket whereas a set is a collection of key value pair which is defined with curly brackets
Hi naveen , if we want integer part in this programme a=2, b=5 and c=b/a and answer will be c=2.5 We can type int (c )and we will get 2, but what we have to do if we want that remaining 0.5
list is a collection of data and mutable (we can change the data and modified the data) and ordered and it can allow the duplicate values. where as set is mutable(in python) unordered , and it never allows the duplicate values
Hi Navin...I have subscribed your channel, your stuff is really incredible. Just want to know, if I also "Join" , will I be able to access more videos or premium videos on advanced programming?? Please guide
Hello Naveen..I loved your videos on Python.I have one question ..Can you please provide an example where classes have been used and how? It can be for any language not specially for Python.
Hello Sir. Could you please explain more clear on the below case.. a=3.14 id(3.14) id(a) Address is different for float values (how and why) and b=3 id(3) id(b) same address (how and why) ?
The difference between a set and list is that in a set we don't have any order and can't call values by indeces. In a set all values are unique. But in a list we have an order and can adress to any of its values by index
I would like to request you to come up with some interesting stuffs which we can do with Python by writing just 10 lines of code.. something like opening browsers through Python and other stuff like that. Also tell us the way how to learn of own or explore more once we have learnt something. These things actually help a lot. I hope you consider my point. Thank you!
Hello Navin, hope you're doing well. I have a question for you. How the Python is so memory efficient when you change the value of variable "a" it still remains in memory & Python creates a new variable which is named called "a" and it used some different memory address right? So everytime you change the value of "a" in program it consumes some extra memory in Python. Even on the other hand when we are using C++ this memory efficiency concept is true it will always point to the same memory address, doesn't matter how many times you change the value of that variable.
1)Set values are written within { } and lost values are written within [ ]. 2) All mathematical Set operations can be applied on a given set but not on list. 3) In set the values are not repeated but in lost can values can be repeated
difference between sets and lists is sets are a collection of unique elements but lists can have repeated elements. lists are mutable, sets gets the elements in sorted format(default)
list is a collection of elements it has same number or different number here we can create,modify,acess,add,delete etc where in the set is a collection of elements which does not index numbers and dulicate elements are not allowed tuple is smillar to list but in tuple we cannot modify the values,whatever we created in the tuple cannot be changed. in python consant values can be changed according to the scenario and it is simple to get id suppose name=sai.id(name) we get the id number of name and also we create own datatypes enumeration etc
I'm in last sem of my engineering degree and still doing this beginners' course...but I'm definitely nd confidential about saying that...I have learnt Python this well from anywhere else till date. Thank you for such a fantastic representation on Python🥺🌟💯
Ur making fantastic videos big brother loved it very easy to understand to the point n most impressive one i dont get bored watching ur videos amazing thank you keep making more videos ..🤘❤️
in a set there are group of numbers written in correct order in {} form whereas in a list there are group of numbers written in mentioned order in (). set is immutable, list is mutable
*Set* Set is a collection of unique elements & for creating set we use curly brackets {} ,and in set the numbers r not in sequence & here indexing is not supported n it will not support duplicated values *List* list is mutable...it means we can change the values in list. for creating lists we use square brackets [].. Thank you🤗
Can we not use tuple to define a constant? Basically define a tuple with only one element in it? For example: PI = (3.14) Great work with the videos by the way, it is really helpful..
Python a=3.14 Id(3.14) 497661158576 Id(a) 497661158544 (Why in float value's address is different) K=5 Id(5) 497671764064 Id(k) 497671764064 Here address is same Why