Reihan_amn Reihan_amn - 17 days ago 4
Python Question

Error in number of argument in min/max functions in python

I am running a very simple example in Python but I get some errors.
When I run this piece of code:

lst = [1, 3, 4, 6, 7]
maxLSt = max(lst)
print(maxLSt)


I get this error:

maxLSt = max(lst)
TypeError: max() takes exactly 2 arguments (1 given)


What is the cause of this problem?

Answer

Your code works fine. Is this the entire program or is it a part of a huge one. If so provide the entire code. In case if it's the entire program you should try Restarting your Kernel.