1.

What is the difference between dictionary and tuple in Python?

Answer»
DictionaryTuple
A dictionary is an unordered DATA collection in which data will be STORED in the FORM of key-value pairs.A tuple is an ordered data collection.
Elements are accessed using key values.Elements are accessed using numeric index values.
Dictionary can have any number of values.A tuple can have only a pre-defined number of values.
It is USED as a MODEL object.It is useful for returning multiple values from a function.


Discussion

No Comment Found