How to use reduce() with lambda to replace above python code?
Question Answered step-by-step How to use reduce() with lambda to replace above python code? Image transcription text16 def gpa (self) : 17 grades = 18 if len (self . courses . keys ( ) ) == 0: 19 return (0) 20 else: 21 for gpa in self .courses . values() : 22 grades . append (gpa) 23 sum_gpa = sum (grades) 24 return (sum_gpa/float (len(self .courses . keys ( ) ) ) )… Show moreHow to use reduce() with lambda to replace above python code? Computer Science Engineering & Technology Python Programming MATH MISC Share QuestionEmailCopy link Comments (0)


