Reihan_amn Reihan_amn - 8 months ago 34
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)

I get this error:

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

What is the cause of this problem?


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.