EMERGING TRENDS IN COMPUTING
ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
Which of the following is a Python tuple?
|
[1, 2, 3]
|
|
(1, 2, 3)
|
|
{1, 2, 3}
|
|
{ }
|
Explanation:
Detailed explanation-1: -The correct answer to the question “Which of the following is a Python Tuple” is option (B). (1, 2, 3). Because in Python, Tuple is represented in round brackets. So, all the other options are incorrect.
Detailed explanation-2: -8. What type of data is: a=[(1, 1), (2, 4), (3, 9)]? Explanation: The variable a has tuples enclosed in a list making it a list of tuples. 9.
Detailed explanation-3: -()-an empty tuple. (1.0, 9.9, 10)-a tuple containing three numeric objects. (’Casey’, ‘Darin’, ‘Bella’, ‘Mehdi’)-a tuple containing four string objects. (’10’, 101, True)-a tuple containing a string, an integer, and a Boolean object. 28-Mar-2022
There is 1 question to complete.