Re: what is the difference between Tuple and dictionary, List etc

A list can store a sequence of objects in a certain order such that you can index into the list, or iterate over the list. List is a mutable type meaning that lists can be modified after they have been created.

A tuple is similar to a list except it is immutable. There is also a semantic difference between a list and a tuple. To quote Nikow's
answer:

Tuples have structure, lists have order.

A dictionary is a key-value store. It is not ordered and it requires that the keys are hashable. It is fast for lookups by key.

TwitterDavid Winchester, Technical Solutions Architect
Please mark as ANSWER if this is the solution
Keep the forums clean and report to the moderation team!

Re: what is the difference between Tuple and dictionary, List etc

sudip_inn

please come with sample code and situation where people prefer to use tuple not list or dictionary.

This msdn article explains it very well with examples, "A tuple is a data structure that has a specific number and sequence of elements".

Tuples are commonly used in four ways:

To represent a single set of data. For example, a tuple can represent a database record, and its components can represent individual fields of the record.

To provide easy access to, and manipulation of, a data set.

To return multiple values from a method without using out parameters (in C#) or ByRef parameters (in Visual Basic).

To pass multiple values to a method through a single parameter. For example, the Thread.Start(Object)method has a single parameter that lets you supply one value to the method that the thread executes at startup time. If you supply a Tuple<T1, T2, T3>
object as the method argument, you can supply the thread’s startup routine with three items of data.

Besides, you could also refer to the following link to know the tuples.