What is the difference between these both? For loop and Max Function. Which one should I choose? For loop:
numbers = [3, 6, 2, 8, 4, 10]
max = numbers[0]
for number in numbers:
if number > max:
max = number
print(max)
Instead, why can't I use the max function, which is only 1 line of code? Max function:
print(max(3, 6, 2, 8, 4, 10))
Both of them show the same thing on the terminal. Why can't I choose this one?