which of the following is a Python tuple? (i) [1,2,3]. (ii) (1,2,3) (iii) {1,2,3} (iv) { }
Answers
Answer:
The correct answer to the question “Which of the following is a Python Tuple” is an option (B). (1, 2, 3). Because in Python, Tuple is represented in round brackets. So, all the other options are incorrect
Explanation:
A Python Tuple is a comma-separated collection of objects. In some ways, a tuple is similar to a list in terms of indexing, nested objects, and iteration, but a tuple is immutable, unlike lists, which are mutable.
Tuples are used to store multiple items in a single variable.
A tuple is one of the 4 built-in data types in Python used to store collections of data, the other 3 being List, Set, and Dictionary, all with different qualities and uses.
Tuples are written with round brackets.
A tuple is one of the four built-in data types used to store collections in Python. Unlike other data types in python, elements in arrays are ordered and immutable. They are used to store multiple items in a single variable and provide some built-in operations to work with them.
Python offers several collections of data structures such as lists, tuples, sets, and dictionaries. But these tuples are quite similar to lists. Lists, which developers commonly use as a data structure, often confuse how tuples differ from lists.
Let's take a deeper understanding of tuples in python and look at their application, use cases, and how they differ from the commonly used collection of data structures, lists.
We can't change the elements of a tuple or the tuple itself once it's assigned, whereas we can change the elements of a list like they are. variable.
brainly.in/question/41533504
#SPJ1