This is a pretty complicated task, if you only just learned about recursion.
I will walk you through my thinking and then show you the code that I came up with.
Why recursion? Nested datatypes are hard to handle, especially if they can be arbitrarily nested. Recursion is a fine way of dealing with that.
What is this task similar to? Often, you can find a problem where you know the solution to and change that slightly. An average of a list of integers is the sum of the lists' elements divided by the length of the list. The length of the list is trivial, so what about the sum of a list? Easy! Iterate over the list and add the current element to the total. But nested lists?