Functions in programming are very similar to functions in math. I presume you have not worked with functions in math either otherwise this would be more easily understood.
This article provides a less complicated description comparing the 2.
Your professor is correct that your functions should really only perform 1 task. That is the point to a function and why they are so useful in both math and programming. You can create libraries of basic functions that when used together can perform more complicated tasks. A function that performs many different tasks it not as reusable as function that performs a single basic task.