human
Can you show me a Python code for calculating the average of a list.
assistant
Here is a Python code for calculating the average of a list

import math

def average(list_of_numbers):
        """Return the average of a list of numbers."""
        return sum(list_of_numbers) / len(list_of_numbers)

# Enter the list
list1 = [1, 2, 3]

# Calling the function
print((average(list1)))

#Example Output

# 2.0

#Remember to inspect code for bugs.