0

what is max? what is return?

14th Oct 2016, 4:22 AM
Bhargav C
Bhargav C - avatar
2 Answers
+ 2
max ist a function, and returns what is telling. The maximal,it means the highest value from paramaters of this function.
14th Oct 2016, 6:22 AM
Petr Hatina
Petr Hatina - avatar
+ 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
14th Oct 2016, 10:59 AM
Zen
Zen - avatar