List and Tuple

Rakesh Nayak, Nishu Gupta · 2022

List and tuple are two essential iterative objects of sequence in Python. Lists and tuples may be regarded as general-purpose “arrays” that can store any number of Python objects. An index is used to organize and access objects. It’s a fairly generic structure, and the items don’t have to be of the same type: for example, integers, characters, strings and nested lists can all be found on the same list. Tuples are sequences, similar to lists, except a tuple is a series of immutable Python objects, whereas a list is mutable. In contrast to a list, data pieces within a tuple cannot be modified. Parentheses are used in tuples, whereas square brackets are used in lists. In this chapter, we will discuss lists and tuples in-depth, as well as the operations we can do on them.

Read the paper · More papers on PaperTik