+ 1
What is the out put of this code? why?
qamus={"food", "feed", "fed", "food"} print(len(qamus))
4 Respuestas
+ 6
it is a set ,set removes duplicate elements,output is 3
+ 3
3
+ 2
3 because sets don't count duplicates but if it was dictionary [] then 4!
+ 1
please, remember that dictionary ={}
not accepts dupilation, not ordered as well, you can change its elements, the each key or value or both...For the key elements of dictionaries you can use immutable objects only..
List = [ ]
you can change its elements,as well...accepts duplication as well...mutable
Tuple = ( )
ordered , accepts duplication and immutable...Tuples are the programmers' perfect choice, as it is faster , the data is fixed , nothing accedently added or removed or its order could be changed.. Let 's work on Tuples, Thanks for your comments and kind supports.