By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,349 Members | 1,307 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,349 IT Pros & Developers. It's quick & easy.

return reduce(lambda x, y: x.grade+y.grade,

P: n/a
class Customer(object):
def __init__(self, idnumber, review):
self.idnumber = idnumber = [review]

def addReview(self, review):

def averageGrade(self):
tot = 0
for review in
tot += review.grade
return tot / len(

def av_grade(self):
return reduce(lambda x, y: x.grade+y.grade,
now,the function is pointless and incorrect but av_grade doesn't work.
why can't i use reduce like this?
Aug 29 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.