Не могли бы мне помочь понять почему в следующем коде ошибка? Первый элемент в листе общего это название университета, второй количество студентов, третий оплата за обучение каждый студентом.
Надо найти общее количество студентов во всех университетах и сколько они платят за обучение все вместе взятые.
получаю такую ошибку
(<function total_students at 0xb75fa5dc>, <function total_tuition at 0xb75fa614>)

#Define a procedure, total_enrollment, #that takes as an input a list of elements, #where each element is a list containing #three elements: a university name, #the total number of students enrollect, #and the annual tuition. #The procedure should return two numbers, #not a string, #giving the total number of students #enrolled at all of the universities #in the list, and the total tuition #(which is the sum of the number #of students enrolled times the #tuition for each university). udacious_univs = [['Udacity',90000,0]] usa_univs = [ ['California Institute of Technology',2175,37704], ['Harvard',19627,39849], ['Massachusetts Institute of Technology',10566,40732], ['Princeton',7802,37000], ['Rice',5879,35551], ['Stanford',19535,40569], ['Yale',11701,40500] ] #>>> print total_enrollment(udacious_univs) #(90000,0) #>>> print total_enrollment(usa_univs) #(77285,3058581079L) def total_enrollment(p): def total_students(p): total = 0 for e in p: total = total + e[1] return total def total_tuition(p): total = 0 for e in p: total = total + e[1] * e[2] return total return total_students, total_tuition print total_enrollment(usa_univs)
Спасибо за помощь.