def calculate_average(numbers): total = sum(numbers) length = len(numbers) average = total / length return average # مثال استفاده از تابع: list_of_numbers = [3, 5, 7, 9, 12] result = calculate_average(list_of_numbers) print("میانگین اعداد لیست = ", result)