Resolved: Max function, error in console
print('Max is', max(data))
However, an error generated says:
TypeError: 'int' object is not callable.
5 answers ( 1 marked as helpful)
Hey Mohamed,
Thank you for reaching out!
Could you please provide a screenshot of your code?
Kind regads,
365 Hristina

Hey again,
Thank you for the screenshot.
I can't immediately see an issue with the code, it should work without any errors:

Make sure you don't have other uncommented lines except lines 34 and 55. In fact, it would be best if you execute the code in a new file.
Let me know if the issue persists.
Kind regards,
365 Hristina
After i checked that i don't have any other uncommented lines, the issue persisted. However, it worked when i taped "remove all variables" button in the variable explorer window, i still don't know what was the problem, but i noticed that there were two variables (max & num) with the same value of 166, might that be the problem ?
Thanks for your help and fast reponse.
Thank you for the clarification Mohammed!
Removing the variables has indeed resolved the issue because you've removed a previously declared variable called max
(you've given it the same name as the name of the function). Consider the example below:

Using Python keywords as names for variables is a practice you should avoid as it could lead to similar issues.
Kind regards,
365 Hristina :)