0
what is max? what is return?
2 Answers
+ 2
max ist a function, and returns what is telling. The maximal,it means the highest value from paramaters of this function.
+ 2
max() returns the highest value of an iterable (a list for example) or the highest value of two or more arguments.
For example:
max([1, 31, 42, 7, 28]) returns 42
max(421, 1337) returns 1337
max(1, 7, 5) returns 7
etc.
def is to define a function. return exits from the current function and return a value.
For example:
def square(n):
return n*n
print(square(6)) #prints what square(6) returns, ie 36