Python -- Lists and Tuples
List and Tuple are built-in container types defined in Python. Objects of both these types can store different other objects that are accessible by index. List as well as tuple is a sequence data type, just as string. List as well as tuple can store objects which need not be of same type. List : A List is an ordered collection of items (which may be of same or different types) separated by comma and enclosed in square brackets. Tuple: Tuple looks similar to list. The only difference is that comma separated items of same or different type are enclosed in parentheses. Differences between List & Tuple: The obvious difference is the use of square brackets [] in List and parentheses () in tuple as enclosures. However, the important difference is that List as a mutable object and Tuple is an immutable object. If contents of an object can be modified in place, after it has been instantiated, is a mutable object. On the other hand, any operation on immutable object...