-
Create a function named
max_integer
-
This function should take a list as an input parameter and return the maximum number found in the list.
-
You should use a
for
loop to iterate through the list. -
Use the
print()
function to print what the function returns when it is called.- For example:
print(my_function(param))
- For example:
-
Define an auxiliary variable and set the first value to the first element on the list.
-
Then compare the variable with all the items in the list.
-
Replace the value every time the new element is bigger than the one stored in the auxiliary variable.
-
At the end, you will have the biggest number stored in the variable.
5435