Reihan_amn Reihan_amn - 1 year ago 79
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?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download