Computer Science
Assertion (A): Both max() and min() functions are implemented on lists as well as tuples in Python.
Reasoning (R): The max() and min() functions return the highest and the lowest among a set of values stored in a list or tuple respectively.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Python Functions
1 Like
Answer
Both A and R are true and R is the correct explanation of A.
Explanation
Both max() and min() functions are implemented on lists as well as tuples in Python. This is true because both functions can operate on any iterable, including lists and tuples. The max() function returns the highest value among a set of values, and the min() function returns the lowest value among a set of values, whether they are stored in a list or a tuple.
Answered By
1 Like
Related Questions
Assertion (A): Dictionaries in Python are mutable.
Reasoning (R): The data inside a dictionary is stored as the key:value pairs enclosed within the curly braces {}.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Assertion (A): There is no difference between a list and a tuple in Python.
Reasoning (R): The list elements are enclosed within square brackets [] separated by commas and the tuple elements are enclosed within parentheses () separated by commas.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Assertion (A): You can add an element in a dictionary using key:value pair.
Reasoning (R): A new (key:value) pair is added only when the same key doesn't exist in the dictionary. If the key is already present, then the existing key gets updated and the new entry will be made in the dictionary.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
What are the advantages of Python programming language?