class Student:
def __init__(self, name):
self.name = name
self.average = 0
def sortByAverage(student):
return student.average
students =[]
Considering a function has already assigned the average for each instance however the average is assigned as float values, how can I use the sorted() function to sort each of the Student instances in students by their average considering that I'm using sortByAverage as the key and will also need to use float as the key