KnowledgeBoat Logo
|

Computer Science

Consider the following code and find out the error:

tup1=('A', 'school', 10.5, 70)
print max(tup1) 

Python Tuples

3 Likes

Answer

The max() function should be used within parentheses in the print statement. Additionally, for the max() function to work, all elements in the tuple must be of the same type; otherwise, Python cannot compare them, leading to an Error.

Answered By

1 Like


Related Questions